act_with_flags 0.0.4 → 0.2.3

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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -0
  3. data/.rubocop.yml +3 -74
  4. data/.ruby-gemset +1 -1
  5. data/.ruby-version +1 -1
  6. data/.travis.yml +5 -1
  7. data/.watchr +6 -14
  8. data/Appraisals +7 -0
  9. data/Gemfile +1 -4
  10. data/Gemfile.lock +121 -76
  11. data/MIT-LICENSE +20 -0
  12. data/README.md +3 -1
  13. data/Rakefile +3 -15
  14. data/act_with_flags.gemspec +7 -2
  15. data/gemfiles/rails_5.2.gemfile +12 -0
  16. data/gemfiles/rails_6.0.gemfile +12 -0
  17. data/lib/act_with_flags/admin.rb +8 -6
  18. data/lib/act_with_flags/define.rb +28 -7
  19. data/lib/act_with_flags/print.rb +1 -1
  20. data/lib/act_with_flags/utils.rb +2 -3
  21. data/lib/act_with_flags/version.rb +13 -4
  22. data/test/any_all_none_test.rb +4 -2
  23. data/test/clear_test.rb +1 -1
  24. data/test/inheritance_any_test.rb +56 -0
  25. data/test/inheritance_test.rb +73 -0
  26. data/test/internal/app/assets/config/manifest.js +1 -0
  27. data/test/internal/app/controllers/application_controller.rb +3 -0
  28. data/test/internal/app/controllers/orders_controller.rb +16 -0
  29. data/test/internal/app/models/application_record.rb +3 -0
  30. data/test/internal/app/models/order.rb +9 -0
  31. data/test/internal/app/views/layouts/application.html.erb +12 -0
  32. data/test/internal/config/database.yml +3 -0
  33. data/test/internal/config/routes.rb +4 -0
  34. data/test/internal/config/secrets.yml +8 -0
  35. data/test/internal/db/schema.rb +13 -0
  36. data/test/internal_benchmark_test.rb +5 -8
  37. data/test/internal_check_add_test.rb +4 -0
  38. data/test/internal_null_test.rb +3 -3
  39. data/test/internal_one_test.rb +2 -0
  40. data/test/legacy_test.rb +1 -1
  41. data/test/one_test.rb +1 -1
  42. data/test/origin_test.rb +2 -0
  43. data/test/remove_from_test.rb +1 -1
  44. data/test/reset_test.rb +1 -1
  45. data/test/string_test.rb +26 -0
  46. data/test/test_helper.rb +8 -25
  47. metadata +92 -6
  48. data/LICENSE +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 764b0dadf19a5ee7278da0a985cfa7e7484bac02bbc22dfce2fa7b50234f652c
4
- data.tar.gz: 6b4b11c64ded7579b17a152a9927afe8fe4488fe71f1099186097ef14ee9c732
3
+ metadata.gz: 7fc915221f76638c08f3c7d73337c2ceab624f6525e4bc2246edf810ad1adca8
4
+ data.tar.gz: ce62f053478b0b27c9f3c9a0d5d4f353e95d873d75e36fd8a78194c555fd7a03
5
5
  SHA512:
6
- metadata.gz: fcf79af0016d1143daff843c18e9397656e09fad8afec300a1a9588c20371df8237515bf0104390b40bece385a3fc3e24cd72dc30f38de54c89c1550d8cb4c0c
7
- data.tar.gz: 822850d797a7d1f9134e9ba6150fa6455d4a065c54b9653e7931d41336490d42e98d4fd77660ebf8dfcf57286e797e20c351ea396893b17a54effa7a7d56713e
6
+ metadata.gz: 5b4bc81cc1fa4fa3956ac91bb63e2a56c3612e56193a9758e187c16b316514d45d4e62d1a341ca6a6ab1a4a0c109dcbdbe6efbfe5ee83f09f5152bc908f16708
7
+ data.tar.gz: aa6db748397688df46f02236f5c7fb02b2fab5a2be1884dcc432bdd2b7efe61215acf5d7e41a7b19643914633e4aa228a8265a32d441e1a62e9003512043d63e
@@ -0,0 +1,7 @@
1
+ .bundle/
2
+ coverage/
3
+
4
+ *.gem
5
+ *.log
6
+ *.lock
7
+ *.sqlite3
@@ -1,79 +1,8 @@
1
- # inherit_from: .rubocop_todo.yml
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
- - '.watchr'
76
-
77
-
78
-
79
-
8
+ - 'test/**/*'
@@ -1 +1 @@
1
- rails-5.2
1
+ rails-6.0
@@ -1 +1 @@
1
- ruby-2.6.1
1
+ ruby-2.6.6
@@ -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
- # - gemfiles/rails_5.2.gemfile
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
- # when 'test'; run %Q{ruby -I"lib:test" -rubygems #{file}}
20
- when 'test'; run %Q{ruby -I test #{file}}
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
- # %w{test spec}.each { |dir| run "spring rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
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{test spec}.each { |type|
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{test spec}.each { |type|
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 }
@@ -0,0 +1,7 @@
1
+ appraise 'rails-6.0' do
2
+ gem 'rails', '~> 6.0.0'
3
+ end
4
+
5
+ appraise 'rails-5.2' do
6
+ gem 'rails', '~> 5.2.0'
7
+ end
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
@@ -1,142 +1,187 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- act_with_flags (0.0.3)
4
+ act_with_flags (0.2.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- actioncable (5.2.2)
10
- actionpack (= 5.2.2)
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
- actionmailer (5.2.2)
14
- actionpack (= 5.2.2)
15
- actionview (= 5.2.2)
16
- activejob (= 5.2.2)
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 (5.2.2)
20
- actionview (= 5.2.2)
21
- activesupport (= 5.2.2)
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.2)
26
- actionview (5.2.2)
27
- activesupport (= 5.2.2)
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.0, >= 1.0.3)
32
- activejob (5.2.2)
33
- activesupport (= 5.2.2)
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 (5.2.2)
36
- activesupport (= 5.2.2)
37
- activerecord (5.2.2)
38
- activemodel (= 5.2.2)
39
- activesupport (= 5.2.2)
40
- arel (>= 9.0)
41
- activestorage (5.2.2)
42
- actionpack (= 5.2.2)
43
- activerecord (= 5.2.2)
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 (5.2.2)
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
- arel (9.0.0)
51
- benchmark-ips (2.7.2)
52
- builder (3.2.3)
53
- concurrent-ruby (1.1.4)
54
- crass (1.0.4)
55
- docile (1.3.1)
56
- erubi (1.8.0)
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.5.3)
81
+ i18n (1.8.3)
60
82
  concurrent-ruby (~> 1.0)
61
- json (2.2.0)
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.9.2)
70
- mimemagic (0.3.3)
71
- mini_mime (1.0.1)
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.11.3)
74
- nio4r (2.3.1)
75
- nokogiri (1.10.1)
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
- rack (2.0.6)
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 (5.2.2)
82
- actioncable (= 5.2.2)
83
- actionmailer (= 5.2.2)
84
- actionpack (= 5.2.2)
85
- actionview (= 5.2.2)
86
- activejob (= 5.2.2)
87
- activemodel (= 5.2.2)
88
- activerecord (= 5.2.2)
89
- activestorage (= 5.2.2)
90
- activesupport (= 5.2.2)
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 (= 5.2.2)
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.4)
98
- loofah (~> 2.2, >= 2.2.2)
99
- railties (5.2.2)
100
- actionpack (= 5.2.2)
101
- activesupport (= 5.2.2)
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.19.0, < 2.0)
105
- rake (12.3.2)
106
- simplecov (0.16.1)
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
- json (>= 1.8, < 3)
109
- simplecov-html (~> 0.10.0)
110
- simplecov-html (0.10.2)
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.3.13)
119
- thor (0.20.3)
158
+ sqlite3 (1.4.2)
159
+ thor (1.0.1)
120
160
  thread_safe (0.3.6)
121
- tzinfo (1.2.5)
161
+ tzinfo (1.2.7)
122
162
  thread_safe (~> 0.1)
123
- websocket-driver (0.7.0)
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.3)
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
- minitest
177
+ combustion (~> 1)
178
+ minitest (~> 5.0)
135
179
  observr
136
180
  rails
137
- rake (~> 12)
181
+ rake (~> 13)
182
+ rubocop
138
183
  simplecov
139
- sqlite3 (!= 1.4.0)
184
+ sqlite3 (~> 1)
140
185
 
141
186
  BUNDLED WITH
142
- 1.17.2
187
+ 1.17.3