unreliable 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,143 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ unreliable (0.1.0)
5
+ activerecord (>= 5.0)
6
+ railties (>= 5.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (5.2.6.2)
12
+ actionview (= 5.2.6.2)
13
+ activesupport (= 5.2.6.2)
14
+ rack (~> 2.0, >= 2.0.8)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (5.2.6.2)
19
+ activesupport (= 5.2.6.2)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
24
+ activemodel (5.2.6.2)
25
+ activesupport (= 5.2.6.2)
26
+ activerecord (5.2.6.2)
27
+ activemodel (= 5.2.6.2)
28
+ activesupport (= 5.2.6.2)
29
+ arel (>= 9.0)
30
+ activesupport (5.2.6.2)
31
+ concurrent-ruby (~> 1.0, >= 1.0.2)
32
+ i18n (>= 0.7, < 2)
33
+ minitest (~> 5.1)
34
+ tzinfo (~> 1.1)
35
+ appraisal (2.4.1)
36
+ bundler
37
+ rake
38
+ thor (>= 0.14.0)
39
+ arel (9.0.0)
40
+ ast (2.4.2)
41
+ builder (3.2.4)
42
+ combustion (1.3.5)
43
+ activesupport (>= 3.0.0)
44
+ railties (>= 3.0.0)
45
+ thor (>= 0.14.6)
46
+ concurrent-ruby (1.1.9)
47
+ crass (1.0.6)
48
+ diff-lcs (1.5.0)
49
+ docile (1.4.0)
50
+ erubi (1.10.0)
51
+ i18n (1.10.0)
52
+ concurrent-ruby (~> 1.0)
53
+ loofah (2.14.0)
54
+ crass (~> 1.0.2)
55
+ nokogiri (>= 1.5.9)
56
+ method_source (1.0.0)
57
+ minitest (5.15.0)
58
+ nokogiri (1.13.3-x86_64-linux)
59
+ racc (~> 1.4)
60
+ parallel (1.21.0)
61
+ parser (3.1.1.0)
62
+ ast (~> 2.4.1)
63
+ racc (1.6.0)
64
+ rack (2.2.3)
65
+ rack-test (1.1.0)
66
+ rack (>= 1.0, < 3)
67
+ rails-dom-testing (2.0.3)
68
+ activesupport (>= 4.2.0)
69
+ nokogiri (>= 1.6)
70
+ rails-html-sanitizer (1.4.2)
71
+ loofah (~> 2.3)
72
+ railties (5.2.6.2)
73
+ actionpack (= 5.2.6.2)
74
+ activesupport (= 5.2.6.2)
75
+ method_source
76
+ rake (>= 0.8.7)
77
+ thor (>= 0.19.0, < 2.0)
78
+ rainbow (3.1.1)
79
+ rake (13.0.6)
80
+ regexp_parser (2.2.1)
81
+ rexml (3.2.5)
82
+ rspec (3.11.0)
83
+ rspec-core (~> 3.11.0)
84
+ rspec-expectations (~> 3.11.0)
85
+ rspec-mocks (~> 3.11.0)
86
+ rspec-core (3.11.0)
87
+ rspec-support (~> 3.11.0)
88
+ rspec-expectations (3.11.0)
89
+ diff-lcs (>= 1.2.0, < 2.0)
90
+ rspec-support (~> 3.11.0)
91
+ rspec-mocks (3.11.0)
92
+ diff-lcs (>= 1.2.0, < 2.0)
93
+ rspec-support (~> 3.11.0)
94
+ rspec-support (3.11.0)
95
+ rubocop (1.25.1)
96
+ parallel (~> 1.10)
97
+ parser (>= 3.1.0.0)
98
+ rainbow (>= 2.2.2, < 4.0)
99
+ regexp_parser (>= 1.8, < 3.0)
100
+ rexml
101
+ rubocop-ast (>= 1.15.1, < 2.0)
102
+ ruby-progressbar (~> 1.7)
103
+ unicode-display_width (>= 1.4.0, < 3.0)
104
+ rubocop-ast (1.16.0)
105
+ parser (>= 3.1.1.0)
106
+ rubocop-performance (1.13.2)
107
+ rubocop (>= 1.7.0, < 2.0)
108
+ rubocop-ast (>= 0.4.0)
109
+ ruby-progressbar (1.11.0)
110
+ simplecov (0.21.2)
111
+ docile (~> 1.1)
112
+ simplecov-html (~> 0.11)
113
+ simplecov_json_formatter (~> 0.1)
114
+ simplecov-html (0.12.3)
115
+ simplecov_json_formatter (0.1.4)
116
+ sqlite3 (1.3.13)
117
+ standard (1.7.2)
118
+ rubocop (= 1.25.1)
119
+ rubocop-performance (= 1.13.2)
120
+ thor (1.2.1)
121
+ thread_safe (0.3.6)
122
+ tzinfo (1.2.9)
123
+ thread_safe (~> 0.1)
124
+ unicode-display_width (2.1.0)
125
+
126
+ PLATFORMS
127
+ x86_64-linux
128
+
129
+ DEPENDENCIES
130
+ activerecord (~> 5.2.0)
131
+ appraisal (~> 2.4)
132
+ bundler (~> 2.1)
133
+ combustion (~> 1.3)
134
+ rake (~> 13.0)
135
+ rspec
136
+ rubocop (~> 1.25)
137
+ simplecov (~> 0.21)
138
+ sqlite3 (~> 1.3.6)
139
+ standard (~> 1.7)
140
+ unreliable!
141
+
142
+ BUNDLED WITH
143
+ 2.3.8
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 6.0.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,143 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ unreliable (0.1.0)
5
+ activerecord (>= 5.0)
6
+ railties (>= 5.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (6.0.4.6)
12
+ actionview (= 6.0.4.6)
13
+ activesupport (= 6.0.4.6)
14
+ rack (~> 2.0, >= 2.0.8)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
+ actionview (6.0.4.6)
19
+ activesupport (= 6.0.4.6)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
+ activemodel (6.0.4.6)
25
+ activesupport (= 6.0.4.6)
26
+ activerecord (6.0.4.6)
27
+ activemodel (= 6.0.4.6)
28
+ activesupport (= 6.0.4.6)
29
+ activesupport (6.0.4.6)
30
+ concurrent-ruby (~> 1.0, >= 1.0.2)
31
+ i18n (>= 0.7, < 2)
32
+ minitest (~> 5.1)
33
+ tzinfo (~> 1.1)
34
+ zeitwerk (~> 2.2, >= 2.2.2)
35
+ appraisal (2.4.1)
36
+ bundler
37
+ rake
38
+ thor (>= 0.14.0)
39
+ ast (2.4.2)
40
+ builder (3.2.4)
41
+ combustion (1.3.5)
42
+ activesupport (>= 3.0.0)
43
+ railties (>= 3.0.0)
44
+ thor (>= 0.14.6)
45
+ concurrent-ruby (1.1.9)
46
+ crass (1.0.6)
47
+ diff-lcs (1.5.0)
48
+ docile (1.4.0)
49
+ erubi (1.10.0)
50
+ i18n (1.10.0)
51
+ concurrent-ruby (~> 1.0)
52
+ loofah (2.14.0)
53
+ crass (~> 1.0.2)
54
+ nokogiri (>= 1.5.9)
55
+ method_source (1.0.0)
56
+ minitest (5.15.0)
57
+ nokogiri (1.13.3-x86_64-linux)
58
+ racc (~> 1.4)
59
+ parallel (1.21.0)
60
+ parser (3.1.1.0)
61
+ ast (~> 2.4.1)
62
+ racc (1.6.0)
63
+ rack (2.2.3)
64
+ rack-test (1.1.0)
65
+ rack (>= 1.0, < 3)
66
+ rails-dom-testing (2.0.3)
67
+ activesupport (>= 4.2.0)
68
+ nokogiri (>= 1.6)
69
+ rails-html-sanitizer (1.4.2)
70
+ loofah (~> 2.3)
71
+ railties (6.0.4.6)
72
+ actionpack (= 6.0.4.6)
73
+ activesupport (= 6.0.4.6)
74
+ method_source
75
+ rake (>= 0.8.7)
76
+ thor (>= 0.20.3, < 2.0)
77
+ rainbow (3.1.1)
78
+ rake (13.0.6)
79
+ regexp_parser (2.2.1)
80
+ rexml (3.2.5)
81
+ rspec (3.11.0)
82
+ rspec-core (~> 3.11.0)
83
+ rspec-expectations (~> 3.11.0)
84
+ rspec-mocks (~> 3.11.0)
85
+ rspec-core (3.11.0)
86
+ rspec-support (~> 3.11.0)
87
+ rspec-expectations (3.11.0)
88
+ diff-lcs (>= 1.2.0, < 2.0)
89
+ rspec-support (~> 3.11.0)
90
+ rspec-mocks (3.11.0)
91
+ diff-lcs (>= 1.2.0, < 2.0)
92
+ rspec-support (~> 3.11.0)
93
+ rspec-support (3.11.0)
94
+ rubocop (1.25.1)
95
+ parallel (~> 1.10)
96
+ parser (>= 3.1.0.0)
97
+ rainbow (>= 2.2.2, < 4.0)
98
+ regexp_parser (>= 1.8, < 3.0)
99
+ rexml
100
+ rubocop-ast (>= 1.15.1, < 2.0)
101
+ ruby-progressbar (~> 1.7)
102
+ unicode-display_width (>= 1.4.0, < 3.0)
103
+ rubocop-ast (1.16.0)
104
+ parser (>= 3.1.1.0)
105
+ rubocop-performance (1.13.2)
106
+ rubocop (>= 1.7.0, < 2.0)
107
+ rubocop-ast (>= 0.4.0)
108
+ ruby-progressbar (1.11.0)
109
+ simplecov (0.21.2)
110
+ docile (~> 1.1)
111
+ simplecov-html (~> 0.11)
112
+ simplecov_json_formatter (~> 0.1)
113
+ simplecov-html (0.12.3)
114
+ simplecov_json_formatter (0.1.4)
115
+ sqlite3 (1.4.2)
116
+ standard (1.7.2)
117
+ rubocop (= 1.25.1)
118
+ rubocop-performance (= 1.13.2)
119
+ thor (1.2.1)
120
+ thread_safe (0.3.6)
121
+ tzinfo (1.2.9)
122
+ thread_safe (~> 0.1)
123
+ unicode-display_width (2.1.0)
124
+ zeitwerk (2.5.4)
125
+
126
+ PLATFORMS
127
+ x86_64-linux
128
+
129
+ DEPENDENCIES
130
+ activerecord (~> 6.0.0)
131
+ appraisal (~> 2.4)
132
+ bundler (~> 2.1)
133
+ combustion (~> 1.3)
134
+ rake (~> 13.0)
135
+ rspec
136
+ rubocop (~> 1.25)
137
+ simplecov (~> 0.21)
138
+ sqlite3 (~> 1.4)
139
+ standard (~> 1.7)
140
+ unreliable!
141
+
142
+ BUNDLED WITH
143
+ 2.3.8
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 6.1.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,142 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ unreliable (0.1.0)
5
+ activerecord (>= 5.0)
6
+ railties (>= 5.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (6.1.4.6)
12
+ actionview (= 6.1.4.6)
13
+ activesupport (= 6.1.4.6)
14
+ rack (~> 2.0, >= 2.0.9)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
+ actionview (6.1.4.6)
19
+ activesupport (= 6.1.4.6)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
+ activemodel (6.1.4.6)
25
+ activesupport (= 6.1.4.6)
26
+ activerecord (6.1.4.6)
27
+ activemodel (= 6.1.4.6)
28
+ activesupport (= 6.1.4.6)
29
+ activesupport (6.1.4.6)
30
+ concurrent-ruby (~> 1.0, >= 1.0.2)
31
+ i18n (>= 1.6, < 2)
32
+ minitest (>= 5.1)
33
+ tzinfo (~> 2.0)
34
+ zeitwerk (~> 2.3)
35
+ appraisal (2.4.1)
36
+ bundler
37
+ rake
38
+ thor (>= 0.14.0)
39
+ ast (2.4.2)
40
+ builder (3.2.4)
41
+ combustion (1.3.5)
42
+ activesupport (>= 3.0.0)
43
+ railties (>= 3.0.0)
44
+ thor (>= 0.14.6)
45
+ concurrent-ruby (1.1.9)
46
+ crass (1.0.6)
47
+ diff-lcs (1.5.0)
48
+ docile (1.4.0)
49
+ erubi (1.10.0)
50
+ i18n (1.10.0)
51
+ concurrent-ruby (~> 1.0)
52
+ loofah (2.14.0)
53
+ crass (~> 1.0.2)
54
+ nokogiri (>= 1.5.9)
55
+ method_source (1.0.0)
56
+ minitest (5.15.0)
57
+ nokogiri (1.13.3-x86_64-linux)
58
+ racc (~> 1.4)
59
+ parallel (1.21.0)
60
+ parser (3.1.1.0)
61
+ ast (~> 2.4.1)
62
+ racc (1.6.0)
63
+ rack (2.2.3)
64
+ rack-test (1.1.0)
65
+ rack (>= 1.0, < 3)
66
+ rails-dom-testing (2.0.3)
67
+ activesupport (>= 4.2.0)
68
+ nokogiri (>= 1.6)
69
+ rails-html-sanitizer (1.4.2)
70
+ loofah (~> 2.3)
71
+ railties (6.1.4.6)
72
+ actionpack (= 6.1.4.6)
73
+ activesupport (= 6.1.4.6)
74
+ method_source
75
+ rake (>= 0.13)
76
+ thor (~> 1.0)
77
+ rainbow (3.1.1)
78
+ rake (13.0.6)
79
+ regexp_parser (2.2.1)
80
+ rexml (3.2.5)
81
+ rspec (3.11.0)
82
+ rspec-core (~> 3.11.0)
83
+ rspec-expectations (~> 3.11.0)
84
+ rspec-mocks (~> 3.11.0)
85
+ rspec-core (3.11.0)
86
+ rspec-support (~> 3.11.0)
87
+ rspec-expectations (3.11.0)
88
+ diff-lcs (>= 1.2.0, < 2.0)
89
+ rspec-support (~> 3.11.0)
90
+ rspec-mocks (3.11.0)
91
+ diff-lcs (>= 1.2.0, < 2.0)
92
+ rspec-support (~> 3.11.0)
93
+ rspec-support (3.11.0)
94
+ rubocop (1.25.1)
95
+ parallel (~> 1.10)
96
+ parser (>= 3.1.0.0)
97
+ rainbow (>= 2.2.2, < 4.0)
98
+ regexp_parser (>= 1.8, < 3.0)
99
+ rexml
100
+ rubocop-ast (>= 1.15.1, < 2.0)
101
+ ruby-progressbar (~> 1.7)
102
+ unicode-display_width (>= 1.4.0, < 3.0)
103
+ rubocop-ast (1.16.0)
104
+ parser (>= 3.1.1.0)
105
+ rubocop-performance (1.13.2)
106
+ rubocop (>= 1.7.0, < 2.0)
107
+ rubocop-ast (>= 0.4.0)
108
+ ruby-progressbar (1.11.0)
109
+ simplecov (0.21.2)
110
+ docile (~> 1.1)
111
+ simplecov-html (~> 0.11)
112
+ simplecov_json_formatter (~> 0.1)
113
+ simplecov-html (0.12.3)
114
+ simplecov_json_formatter (0.1.4)
115
+ sqlite3 (1.4.2)
116
+ standard (1.7.2)
117
+ rubocop (= 1.25.1)
118
+ rubocop-performance (= 1.13.2)
119
+ thor (1.2.1)
120
+ tzinfo (2.0.4)
121
+ concurrent-ruby (~> 1.0)
122
+ unicode-display_width (2.1.0)
123
+ zeitwerk (2.5.4)
124
+
125
+ PLATFORMS
126
+ x86_64-linux
127
+
128
+ DEPENDENCIES
129
+ activerecord (~> 6.1.0)
130
+ appraisal (~> 2.4)
131
+ bundler (~> 2.1)
132
+ combustion (~> 1.3)
133
+ rake (~> 13.0)
134
+ rspec
135
+ rubocop (~> 1.25)
136
+ simplecov (~> 0.21)
137
+ sqlite3 (~> 1.4)
138
+ standard (~> 1.7)
139
+ unreliable!
140
+
141
+ BUNDLED WITH
142
+ 2.3.8
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 7.0.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,142 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ unreliable (0.1.0)
5
+ activerecord (>= 5.0)
6
+ railties (>= 5.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (7.0.2.2)
12
+ actionview (= 7.0.2.2)
13
+ activesupport (= 7.0.2.2)
14
+ rack (~> 2.0, >= 2.2.0)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
+ actionview (7.0.2.2)
19
+ activesupport (= 7.0.2.2)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
+ activemodel (7.0.2.2)
25
+ activesupport (= 7.0.2.2)
26
+ activerecord (7.0.2.2)
27
+ activemodel (= 7.0.2.2)
28
+ activesupport (= 7.0.2.2)
29
+ activesupport (7.0.2.2)
30
+ concurrent-ruby (~> 1.0, >= 1.0.2)
31
+ i18n (>= 1.6, < 2)
32
+ minitest (>= 5.1)
33
+ tzinfo (~> 2.0)
34
+ appraisal (2.4.1)
35
+ bundler
36
+ rake
37
+ thor (>= 0.14.0)
38
+ ast (2.4.2)
39
+ builder (3.2.4)
40
+ combustion (1.3.5)
41
+ activesupport (>= 3.0.0)
42
+ railties (>= 3.0.0)
43
+ thor (>= 0.14.6)
44
+ concurrent-ruby (1.1.9)
45
+ crass (1.0.6)
46
+ diff-lcs (1.5.0)
47
+ docile (1.4.0)
48
+ erubi (1.10.0)
49
+ i18n (1.10.0)
50
+ concurrent-ruby (~> 1.0)
51
+ loofah (2.14.0)
52
+ crass (~> 1.0.2)
53
+ nokogiri (>= 1.5.9)
54
+ method_source (1.0.0)
55
+ minitest (5.15.0)
56
+ nokogiri (1.13.3-x86_64-linux)
57
+ racc (~> 1.4)
58
+ parallel (1.21.0)
59
+ parser (3.1.1.0)
60
+ ast (~> 2.4.1)
61
+ racc (1.6.0)
62
+ rack (2.2.3)
63
+ rack-test (1.1.0)
64
+ rack (>= 1.0, < 3)
65
+ rails-dom-testing (2.0.3)
66
+ activesupport (>= 4.2.0)
67
+ nokogiri (>= 1.6)
68
+ rails-html-sanitizer (1.4.2)
69
+ loofah (~> 2.3)
70
+ railties (7.0.2.2)
71
+ actionpack (= 7.0.2.2)
72
+ activesupport (= 7.0.2.2)
73
+ method_source
74
+ rake (>= 12.2)
75
+ thor (~> 1.0)
76
+ zeitwerk (~> 2.5)
77
+ rainbow (3.1.1)
78
+ rake (13.0.6)
79
+ regexp_parser (2.2.1)
80
+ rexml (3.2.5)
81
+ rspec (3.11.0)
82
+ rspec-core (~> 3.11.0)
83
+ rspec-expectations (~> 3.11.0)
84
+ rspec-mocks (~> 3.11.0)
85
+ rspec-core (3.11.0)
86
+ rspec-support (~> 3.11.0)
87
+ rspec-expectations (3.11.0)
88
+ diff-lcs (>= 1.2.0, < 2.0)
89
+ rspec-support (~> 3.11.0)
90
+ rspec-mocks (3.11.0)
91
+ diff-lcs (>= 1.2.0, < 2.0)
92
+ rspec-support (~> 3.11.0)
93
+ rspec-support (3.11.0)
94
+ rubocop (1.25.1)
95
+ parallel (~> 1.10)
96
+ parser (>= 3.1.0.0)
97
+ rainbow (>= 2.2.2, < 4.0)
98
+ regexp_parser (>= 1.8, < 3.0)
99
+ rexml
100
+ rubocop-ast (>= 1.15.1, < 2.0)
101
+ ruby-progressbar (~> 1.7)
102
+ unicode-display_width (>= 1.4.0, < 3.0)
103
+ rubocop-ast (1.16.0)
104
+ parser (>= 3.1.1.0)
105
+ rubocop-performance (1.13.2)
106
+ rubocop (>= 1.7.0, < 2.0)
107
+ rubocop-ast (>= 0.4.0)
108
+ ruby-progressbar (1.11.0)
109
+ simplecov (0.21.2)
110
+ docile (~> 1.1)
111
+ simplecov-html (~> 0.11)
112
+ simplecov_json_formatter (~> 0.1)
113
+ simplecov-html (0.12.3)
114
+ simplecov_json_formatter (0.1.4)
115
+ sqlite3 (1.4.2)
116
+ standard (1.7.2)
117
+ rubocop (= 1.25.1)
118
+ rubocop-performance (= 1.13.2)
119
+ thor (1.2.1)
120
+ tzinfo (2.0.4)
121
+ concurrent-ruby (~> 1.0)
122
+ unicode-display_width (2.1.0)
123
+ zeitwerk (2.5.4)
124
+
125
+ PLATFORMS
126
+ x86_64-linux
127
+
128
+ DEPENDENCIES
129
+ activerecord (~> 7.0.0)
130
+ appraisal (~> 2.4)
131
+ bundler (~> 2.1)
132
+ combustion (~> 1.3)
133
+ rake (~> 13.0)
134
+ rspec
135
+ rubocop (~> 1.25)
136
+ simplecov (~> 0.21)
137
+ sqlite3 (~> 1.4)
138
+ standard (~> 1.7)
139
+ unreliable!
140
+
141
+ BUNDLED WITH
142
+ 2.3.8
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Override ActiveRecord::QueryMethods.build_order to always append a final ORDER(RAND())
4
+
5
+ require "active_record/connection_adapters/abstract_adapter"
6
+
7
+ module Unreliable
8
+ module BuildOrder
9
+ def build_order(arel)
10
+ super(arel)
11
+
12
+ return unless Unreliable::Config.enabled?
13
+
14
+ case Arel::Table.engine.connection.adapter_name
15
+ when "Mysql2"
16
+ # https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html#function_rand
17
+ arel.order("RAND()")
18
+
19
+ when "PostgreSQL", "SQLite"
20
+ # https://www.postgresql.org/docs/13/functions-math.html#FUNCTIONS-MATH-RANDOM-TABLE
21
+ # https://www.sqlite.org/lang_corefunc.html#random
22
+ arel.order("RANDOM()")
23
+
24
+ else
25
+ raise ArgumentError, "unknown Arel::Table.engine"
26
+
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Unreliable
4
+ class Config
5
+ def self.setup!
6
+ @enabled = true
7
+ end
8
+
9
+ def self.enabled?
10
+ @enabled && Rails.env.test?
11
+ end
12
+
13
+ def self.disable
14
+ prev_enabled = @enabled
15
+ @enabled = false
16
+ yield
17
+ ensure
18
+ @enabled = prev_enabled
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_record/relation"
4
+ require "active_record/relation/query_methods"
5
+ require "rails/railtie"
6
+
7
+ module Unreliable
8
+ class Railtie < ::Rails::Railtie
9
+ config.to_prepare do
10
+ Unreliable::Config.setup!
11
+ end
12
+
13
+ initializer "unreliable.build_order_patch" do
14
+ if Rails.env.test?
15
+ ActiveSupport.on_load(:active_record) do
16
+ ::ActiveRecord::Relation.prepend ::Unreliable::BuildOrder
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Unreliable
4
+ VERSION = "0.1.0"
5
+ end
data/lib/unreliable.rb ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_record"
4
+ require_relative "unreliable/build_order"
5
+ require_relative "unreliable/config"
6
+ require_relative "unreliable/railtie"
7
+ require_relative "unreliable/version"
8
+
9
+ module Unreliable
10
+ end
data/spec/env_spec.rb ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe Unreliable do
4
+ it "does nothing in prod" do
5
+ Rails.env = "production"
6
+ expect(Thing.where(word: "foo").to_sql).to end_with(%q(WHERE "things"."word" = 'foo'))
7
+ ensure
8
+ Rails.env = "test"
9
+ end
10
+
11
+ it "does nothing in dev" do
12
+ Rails.env = "development"
13
+ expect(Thing.where(word: "foo").to_sql).to end_with(%q(WHERE "things"."word" = 'foo'))
14
+ ensure
15
+ Rails.env = "test"
16
+ end
17
+ end