act_with_flags 0.0.4 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +7 -0
- data/.rubocop.yml +3 -74
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/.travis.yml +5 -1
- data/.watchr +6 -14
- data/Appraisals +7 -0
- data/Gemfile +1 -4
- data/Gemfile.lock +121 -76
- data/MIT-LICENSE +20 -0
- data/README.md +3 -1
- data/Rakefile +3 -15
- data/act_with_flags.gemspec +7 -2
- data/gemfiles/rails_5.2.gemfile +12 -0
- data/gemfiles/rails_6.0.gemfile +12 -0
- data/lib/act_with_flags/admin.rb +8 -6
- data/lib/act_with_flags/define.rb +28 -7
- data/lib/act_with_flags/print.rb +1 -1
- data/lib/act_with_flags/utils.rb +2 -3
- data/lib/act_with_flags/version.rb +13 -4
- data/test/any_all_none_test.rb +4 -2
- data/test/clear_test.rb +1 -1
- data/test/inheritance_any_test.rb +56 -0
- data/test/inheritance_test.rb +73 -0
- data/test/internal/app/assets/config/manifest.js +1 -0
- data/test/internal/app/controllers/application_controller.rb +3 -0
- data/test/internal/app/controllers/orders_controller.rb +16 -0
- data/test/internal/app/models/application_record.rb +3 -0
- data/test/internal/app/models/order.rb +9 -0
- data/test/internal/app/views/layouts/application.html.erb +12 -0
- data/test/internal/config/database.yml +3 -0
- data/test/internal/config/routes.rb +4 -0
- data/test/internal/config/secrets.yml +8 -0
- data/test/internal/db/schema.rb +13 -0
- data/test/internal_benchmark_test.rb +5 -8
- data/test/internal_check_add_test.rb +4 -0
- data/test/internal_null_test.rb +3 -3
- data/test/internal_one_test.rb +2 -0
- data/test/legacy_test.rb +1 -1
- data/test/one_test.rb +1 -1
- data/test/origin_test.rb +2 -0
- data/test/remove_from_test.rb +1 -1
- data/test/reset_test.rb +1 -1
- data/test/string_test.rb +26 -0
- data/test/test_helper.rb +8 -25
- metadata +92 -6
- data/LICENSE +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fc915221f76638c08f3c7d73337c2ceab624f6525e4bc2246edf810ad1adca8
|
4
|
+
data.tar.gz: ce62f053478b0b27c9f3c9a0d5d4f353e95d873d75e36fd8a78194c555fd7a03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b4bc81cc1fa4fa3956ac91bb63e2a56c3612e56193a9758e187c16b316514d45d4e62d1a341ca6a6ab1a4a0c109dcbdbe6efbfe5ee83f09f5152bc908f16708
|
7
|
+
data.tar.gz: aa6db748397688df46f02236f5c7fb02b2fab5a2be1884dcc432bdd2b7efe61215acf5d7e41a7b19643914633e4aa228a8265a32d441e1a62e9003512043d63e
|
data/.gitignore
ADDED
data/.rubocop.yml
CHANGED
@@ -1,79 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# rubocop --auto-gen-config
|
4
|
-
# rubocop
|
5
|
-
# rubocop:disable all
|
6
|
-
|
7
|
-
#inherit_from: .rubocop_todo.yml
|
1
|
+
inherit_from:
|
2
|
+
- ~/configs/.rubocop.yml
|
8
3
|
|
9
4
|
AllCops:
|
10
5
|
Include:
|
11
|
-
- 'app/**/*.rb'
|
12
|
-
- 'bin/**/*.rb'
|
13
|
-
- 'lib/**/*.rb'
|
14
|
-
|
15
|
-
- 'config/**/*.rb'
|
16
|
-
- 'db/**/*.rb'
|
17
6
|
- 'lib/**/*.rb'
|
18
|
-
- 'test/**/*.rb' # 581 offenses
|
19
|
-
- '**/*.gemfile'
|
20
|
-
- '**/*.gemspec'
|
21
|
-
- '**/*.rake'
|
22
|
-
- '**/*.ru'
|
23
|
-
- '**/Gemfile'
|
24
|
-
# - '**/Rakefile'
|
25
|
-
|
26
|
-
#AllCops:
|
27
|
-
# Exclude:
|
28
|
-
# - 'db/**/*'
|
29
|
-
# - 'config/**/*'
|
30
|
-
# - 'script/**/*'
|
31
|
-
# - 'bin/{rails,rake}'
|
32
|
-
# - 'spec/**/*'
|
33
|
-
# - !ruby/regexp /old_and_unused\.rb$/
|
34
|
-
|
35
|
-
Bundler/OrderedGems:
|
36
|
-
Exclude:
|
37
|
-
- 'Gemfile'
|
38
|
-
|
39
|
-
Layout/AccessModifierIndentation:
|
40
|
-
Enabled: false
|
41
|
-
Layout/AlignArray:
|
42
|
-
Enabled: false
|
43
|
-
Layout/CommentIndentation:
|
44
|
-
Enabled: false
|
45
|
-
Layout/EmptyLinesAroundAccessModifier:
|
46
|
-
Enabled: false
|
47
|
-
Layout/EmptyLinesAroundBlockBody:
|
48
|
-
Enabled: false
|
49
|
-
Layout/EmptyLinesAroundClassBody:
|
50
|
-
Enabled: false
|
51
|
-
Layout/ExtraSpacing:
|
52
|
-
Enabled: false
|
53
|
-
Layout/IndentArray:
|
54
|
-
Enabled: false
|
55
|
-
Layout/IndentationWidth:
|
56
|
-
Enabled: false
|
57
|
-
Layout/LeadingCommentSpace:
|
58
|
-
Enabled: false
|
59
|
-
Layout/Tab:
|
60
|
-
Enabled: false
|
61
|
-
|
62
|
-
Lint/UnusedBlockArgument:
|
63
|
-
Enabled: false
|
64
|
-
|
65
|
-
Style/BlockDelimiters:
|
66
|
-
Enabled: false
|
67
|
-
Style/Documentation:
|
68
|
-
Enabled: false
|
69
|
-
Style/FormatString:
|
70
|
-
Enabled: false
|
71
|
-
Style/FrozenStringLiteralComment:
|
72
|
-
Enabled: false
|
73
|
-
Style/WhenThen:
|
74
7
|
Exclude:
|
75
|
-
- '
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
8
|
+
- 'test/**/*'
|
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails-
|
1
|
+
rails-6.0
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.6.
|
1
|
+
ruby-2.6.6
|
data/.travis.yml
CHANGED
@@ -8,10 +8,14 @@ bundler_args: --without production
|
|
8
8
|
script: "bundle exec rake test"
|
9
9
|
|
10
10
|
rvm:
|
11
|
+
- 2.6.6
|
12
|
+
# - 2.6.5
|
13
|
+
# - 2.6.4
|
11
14
|
- 2.6.1
|
12
15
|
|
13
16
|
gemfile:
|
14
|
-
|
17
|
+
- gemfiles/rails_6.0.gemfile
|
18
|
+
- gemfiles/rails_5.2.gemfile
|
15
19
|
|
16
20
|
matrix:
|
17
21
|
|
data/.watchr
CHANGED
@@ -16,38 +16,30 @@ end
|
|
16
16
|
|
17
17
|
def run_it(type, file)
|
18
18
|
case type
|
19
|
-
|
20
|
-
when '
|
21
|
-
# when 'test'; run %Q{rails test #{file}}
|
22
|
-
# when 'spec'; run %Q{spring rspec -X #{file}}
|
19
|
+
when 'test'; run %(ruby -I test #{file})
|
20
|
+
# when 'spec'; run %(rspec -X #{file})
|
23
21
|
else; puts "#{H} unknown type: #{type}, file: #{file}"
|
24
22
|
end
|
25
23
|
end
|
26
24
|
|
27
25
|
def run_all_tests
|
28
26
|
puts "\n#{HH} Running all tests #{HH}\n"
|
29
|
-
|
30
|
-
# %w{test}.each { |dir| run "spring rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
|
31
|
-
%w{test}.each { |dir| run "rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
|
27
|
+
%w[test spec].each { |dir| run "rake #{dir}" if File.exist?(dir) }
|
32
28
|
end
|
33
29
|
|
34
30
|
def run_matching_files(base)
|
35
31
|
base = base.split('_').first
|
36
|
-
%w
|
32
|
+
%w[test spec].each { |type|
|
37
33
|
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
|
38
34
|
run_it type, files.join(' ') unless files.empty?
|
39
35
|
}
|
40
36
|
end
|
41
37
|
|
42
|
-
%w
|
38
|
+
%w[test spec].each { |type|
|
43
39
|
watch("#{type}/#{type}_helper\.rb") { run_all_tests }
|
40
|
+
watch('lib/.*\.rb') { run_all_tests }
|
44
41
|
watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
|
45
42
|
}
|
46
|
-
%w{rb erb haml slim}.each { |type|
|
47
|
-
watch("app/.*/.*\.#{type}") { |m|
|
48
|
-
run_matching_files("#{m[0].split('/').at(2).split('.').first}")
|
49
|
-
}
|
50
|
-
}
|
51
43
|
|
52
44
|
# Ctrl-\ or ctrl-4
|
53
45
|
Signal.trap('QUIT') { run_all_tests }
|
data/Appraisals
ADDED
data/Gemfile
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
#ruby '2.6.0'
|
3
2
|
gemspec
|
4
3
|
|
5
4
|
gem 'rails'
|
6
5
|
|
7
6
|
group :test do
|
8
7
|
gem 'observr'
|
8
|
+
gem 'rubocop', require: false
|
9
9
|
gem 'simplecov', require: false
|
10
|
-
gem 'minitest'
|
11
|
-
gem 'sqlite3', '!= 1.4.0'
|
12
10
|
gem 'benchmark-ips'
|
13
|
-
# gem 'sqlite3'
|
14
11
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,142 +1,187 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
act_with_flags (0.
|
4
|
+
act_with_flags (0.2.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
actioncable (
|
10
|
-
actionpack (=
|
9
|
+
actioncable (6.0.3.2)
|
10
|
+
actionpack (= 6.0.3.2)
|
11
11
|
nio4r (~> 2.0)
|
12
12
|
websocket-driver (>= 0.6.1)
|
13
|
-
|
14
|
-
actionpack (=
|
15
|
-
|
16
|
-
|
13
|
+
actionmailbox (6.0.3.2)
|
14
|
+
actionpack (= 6.0.3.2)
|
15
|
+
activejob (= 6.0.3.2)
|
16
|
+
activerecord (= 6.0.3.2)
|
17
|
+
activestorage (= 6.0.3.2)
|
18
|
+
activesupport (= 6.0.3.2)
|
19
|
+
mail (>= 2.7.1)
|
20
|
+
actionmailer (6.0.3.2)
|
21
|
+
actionpack (= 6.0.3.2)
|
22
|
+
actionview (= 6.0.3.2)
|
23
|
+
activejob (= 6.0.3.2)
|
17
24
|
mail (~> 2.5, >= 2.5.4)
|
18
25
|
rails-dom-testing (~> 2.0)
|
19
|
-
actionpack (
|
20
|
-
actionview (=
|
21
|
-
activesupport (=
|
22
|
-
rack (~> 2.0)
|
26
|
+
actionpack (6.0.3.2)
|
27
|
+
actionview (= 6.0.3.2)
|
28
|
+
activesupport (= 6.0.3.2)
|
29
|
+
rack (~> 2.0, >= 2.0.8)
|
23
30
|
rack-test (>= 0.6.3)
|
24
31
|
rails-dom-testing (~> 2.0)
|
25
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
26
|
-
|
27
|
-
|
32
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
33
|
+
actiontext (6.0.3.2)
|
34
|
+
actionpack (= 6.0.3.2)
|
35
|
+
activerecord (= 6.0.3.2)
|
36
|
+
activestorage (= 6.0.3.2)
|
37
|
+
activesupport (= 6.0.3.2)
|
38
|
+
nokogiri (>= 1.8.5)
|
39
|
+
actionview (6.0.3.2)
|
40
|
+
activesupport (= 6.0.3.2)
|
28
41
|
builder (~> 3.1)
|
29
42
|
erubi (~> 1.4)
|
30
43
|
rails-dom-testing (~> 2.0)
|
31
|
-
rails-html-sanitizer (~> 1.
|
32
|
-
activejob (
|
33
|
-
activesupport (=
|
44
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
45
|
+
activejob (6.0.3.2)
|
46
|
+
activesupport (= 6.0.3.2)
|
34
47
|
globalid (>= 0.3.6)
|
35
|
-
activemodel (
|
36
|
-
activesupport (=
|
37
|
-
activerecord (
|
38
|
-
activemodel (=
|
39
|
-
activesupport (=
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
activerecord (=
|
48
|
+
activemodel (6.0.3.2)
|
49
|
+
activesupport (= 6.0.3.2)
|
50
|
+
activerecord (6.0.3.2)
|
51
|
+
activemodel (= 6.0.3.2)
|
52
|
+
activesupport (= 6.0.3.2)
|
53
|
+
activestorage (6.0.3.2)
|
54
|
+
actionpack (= 6.0.3.2)
|
55
|
+
activejob (= 6.0.3.2)
|
56
|
+
activerecord (= 6.0.3.2)
|
44
57
|
marcel (~> 0.3.1)
|
45
|
-
activesupport (
|
58
|
+
activesupport (6.0.3.2)
|
46
59
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
47
60
|
i18n (>= 0.7, < 2)
|
48
61
|
minitest (~> 5.1)
|
49
62
|
tzinfo (~> 1.1)
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
63
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
64
|
+
appraisal (2.3.0)
|
65
|
+
bundler
|
66
|
+
rake
|
67
|
+
thor (>= 0.14.0)
|
68
|
+
ast (2.4.1)
|
69
|
+
benchmark-ips (2.8.2)
|
70
|
+
builder (3.2.4)
|
71
|
+
combustion (1.3.0)
|
72
|
+
activesupport (>= 3.0.0)
|
73
|
+
railties (>= 3.0.0)
|
74
|
+
thor (>= 0.14.6)
|
75
|
+
concurrent-ruby (1.1.6)
|
76
|
+
crass (1.0.6)
|
77
|
+
docile (1.3.2)
|
78
|
+
erubi (1.9.0)
|
57
79
|
globalid (0.4.2)
|
58
80
|
activesupport (>= 4.2.0)
|
59
|
-
i18n (1.
|
81
|
+
i18n (1.8.3)
|
60
82
|
concurrent-ruby (~> 1.0)
|
61
|
-
|
62
|
-
loofah (2.2.3)
|
83
|
+
loofah (2.6.0)
|
63
84
|
crass (~> 1.0.2)
|
64
85
|
nokogiri (>= 1.5.9)
|
65
86
|
mail (2.7.1)
|
66
87
|
mini_mime (>= 0.1.1)
|
67
88
|
marcel (0.3.3)
|
68
89
|
mimemagic (~> 0.3.2)
|
69
|
-
method_source (0.
|
70
|
-
mimemagic (0.3.
|
71
|
-
mini_mime (1.0.
|
90
|
+
method_source (1.0.0)
|
91
|
+
mimemagic (0.3.5)
|
92
|
+
mini_mime (1.0.2)
|
72
93
|
mini_portile2 (2.4.0)
|
73
|
-
minitest (5.
|
74
|
-
nio4r (2.
|
75
|
-
nokogiri (1.10.
|
94
|
+
minitest (5.14.1)
|
95
|
+
nio4r (2.5.2)
|
96
|
+
nokogiri (1.10.10)
|
76
97
|
mini_portile2 (~> 2.4.0)
|
77
98
|
observr (1.0.5)
|
78
|
-
|
99
|
+
parallel (1.19.2)
|
100
|
+
parser (2.7.1.4)
|
101
|
+
ast (~> 2.4.1)
|
102
|
+
rack (2.2.3)
|
79
103
|
rack-test (1.1.0)
|
80
104
|
rack (>= 1.0, < 3)
|
81
|
-
rails (
|
82
|
-
actioncable (=
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
105
|
+
rails (6.0.3.2)
|
106
|
+
actioncable (= 6.0.3.2)
|
107
|
+
actionmailbox (= 6.0.3.2)
|
108
|
+
actionmailer (= 6.0.3.2)
|
109
|
+
actionpack (= 6.0.3.2)
|
110
|
+
actiontext (= 6.0.3.2)
|
111
|
+
actionview (= 6.0.3.2)
|
112
|
+
activejob (= 6.0.3.2)
|
113
|
+
activemodel (= 6.0.3.2)
|
114
|
+
activerecord (= 6.0.3.2)
|
115
|
+
activestorage (= 6.0.3.2)
|
116
|
+
activesupport (= 6.0.3.2)
|
91
117
|
bundler (>= 1.3.0)
|
92
|
-
railties (=
|
118
|
+
railties (= 6.0.3.2)
|
93
119
|
sprockets-rails (>= 2.0.0)
|
94
120
|
rails-dom-testing (2.0.3)
|
95
121
|
activesupport (>= 4.2.0)
|
96
122
|
nokogiri (>= 1.6)
|
97
|
-
rails-html-sanitizer (1.0
|
98
|
-
loofah (~> 2.
|
99
|
-
railties (
|
100
|
-
actionpack (=
|
101
|
-
activesupport (=
|
123
|
+
rails-html-sanitizer (1.3.0)
|
124
|
+
loofah (~> 2.3)
|
125
|
+
railties (6.0.3.2)
|
126
|
+
actionpack (= 6.0.3.2)
|
127
|
+
activesupport (= 6.0.3.2)
|
102
128
|
method_source
|
103
129
|
rake (>= 0.8.7)
|
104
|
-
thor (>= 0.
|
105
|
-
|
106
|
-
|
130
|
+
thor (>= 0.20.3, < 2.0)
|
131
|
+
rainbow (3.0.0)
|
132
|
+
rake (13.0.1)
|
133
|
+
regexp_parser (1.7.1)
|
134
|
+
rexml (3.2.4)
|
135
|
+
rubocop (0.88.0)
|
136
|
+
parallel (~> 1.10)
|
137
|
+
parser (>= 2.7.1.1)
|
138
|
+
rainbow (>= 2.2.2, < 4.0)
|
139
|
+
regexp_parser (>= 1.7)
|
140
|
+
rexml
|
141
|
+
rubocop-ast (>= 0.1.0, < 1.0)
|
142
|
+
ruby-progressbar (~> 1.7)
|
143
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
144
|
+
rubocop-ast (0.1.0)
|
145
|
+
parser (>= 2.7.0.1)
|
146
|
+
ruby-progressbar (1.10.1)
|
147
|
+
simplecov (0.18.5)
|
107
148
|
docile (~> 1.1)
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
sprockets (3.7.2)
|
149
|
+
simplecov-html (~> 0.11)
|
150
|
+
simplecov-html (0.12.2)
|
151
|
+
sprockets (4.0.2)
|
112
152
|
concurrent-ruby (~> 1.0)
|
113
153
|
rack (> 1, < 3)
|
114
154
|
sprockets-rails (3.2.1)
|
115
155
|
actionpack (>= 4.0)
|
116
156
|
activesupport (>= 4.0)
|
117
157
|
sprockets (>= 3.0.0)
|
118
|
-
sqlite3 (1.
|
119
|
-
thor (0.
|
158
|
+
sqlite3 (1.4.2)
|
159
|
+
thor (1.0.1)
|
120
160
|
thread_safe (0.3.6)
|
121
|
-
tzinfo (1.2.
|
161
|
+
tzinfo (1.2.7)
|
122
162
|
thread_safe (~> 0.1)
|
123
|
-
|
163
|
+
unicode-display_width (1.7.0)
|
164
|
+
websocket-driver (0.7.3)
|
124
165
|
websocket-extensions (>= 0.1.0)
|
125
|
-
websocket-extensions (0.1.
|
166
|
+
websocket-extensions (0.1.5)
|
167
|
+
zeitwerk (2.3.1)
|
126
168
|
|
127
169
|
PLATFORMS
|
128
170
|
ruby
|
129
171
|
|
130
172
|
DEPENDENCIES
|
131
173
|
act_with_flags!
|
174
|
+
appraisal (~> 2)
|
132
175
|
benchmark-ips
|
133
176
|
bundler (~> 1)
|
134
|
-
|
177
|
+
combustion (~> 1)
|
178
|
+
minitest (~> 5.0)
|
135
179
|
observr
|
136
180
|
rails
|
137
|
-
rake (~>
|
181
|
+
rake (~> 13)
|
182
|
+
rubocop
|
138
183
|
simplecov
|
139
|
-
sqlite3 (
|
184
|
+
sqlite3 (~> 1)
|
140
185
|
|
141
186
|
BUNDLED WITH
|
142
|
-
1.17.
|
187
|
+
1.17.3
|