act_with_flags 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +14 -0
- data/.github/workflows/rake.yml +2 -3
- data/.ruby-version +1 -1
- data/.watchr +6 -6
- data/Gemfile +3 -3
- data/Gemfile.lock +85 -88
- data/README.md +1 -0
- data/lib/act_with_flags/version.rb +2 -1
- data/test/any_all_none_test.rb +1 -1
- data/test/benchmark_test.rb +4 -4
- data/test/coding_check_add_test.rb +3 -3
- data/test/coding_coverage_test.rb +1 -1
- data/test/coding_null_test.rb +1 -1
- data/test/coding_one_test.rb +2 -2
- data/test/legacy_test.rb +2 -2
- data/test/null_test.rb +9 -0
- data/test/one_test.rb +8 -2
- data/test/range_test.rb +0 -39
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6f3af684df146594e5adbebc473d3a46c789f4a27021421e4831ca10a893ab9
|
4
|
+
data.tar.gz: 9ea6c4313f83e3ab4e3811540e7bbb14a63b98c2a9bc9536136b9682bcb1f067
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e64f4c29f48415f5c9dc42239269ffae1668d3f0b270c722959db78d4206b4192f0c9b25283ae6494d5349bf428d98183c1e36803acfbbfd9f4ea4ef9063e93
|
7
|
+
data.tar.gz: 4ba44b4047ba9ddb283e85497bc2c6662b4341fb2a9e2955c81164cfcebf16aedc9c0b42a8447788e3ed9a6fcb83ac1fec465b7d11c4678ddc6c75ac08f89e1a
|
@@ -0,0 +1,14 @@
|
|
1
|
+
name: Lint
|
2
|
+
on: push
|
3
|
+
jobs:
|
4
|
+
lint:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
steps:
|
7
|
+
- name: Checkout code
|
8
|
+
uses: actions/checkout@v2
|
9
|
+
- name: Set up Ruby
|
10
|
+
uses: ruby/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
bundler-cache: true
|
13
|
+
- name: Run Standard
|
14
|
+
run: bundle exec standardrb
|
data/.github/workflows/rake.yml
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# see also https://github.com/whitequark/parser/blob/master/.github/workflows/test.yml
|
2
2
|
name: Rake
|
3
3
|
|
4
|
-
|
5
|
-
on: [push]
|
4
|
+
on: push
|
6
5
|
|
7
6
|
jobs:
|
8
7
|
test:
|
@@ -13,7 +12,7 @@ jobs:
|
|
13
12
|
os: [ubuntu-latest]
|
14
13
|
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
15
14
|
# ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
|
16
|
-
ruby: ["2.7.2",
|
15
|
+
ruby: ["2.7.2", 3.0.1, head]
|
17
16
|
test_command: ["bundle exec rake test"]
|
18
17
|
runs-on: ${{ matrix.os }}
|
19
18
|
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-3.1.
|
1
|
+
ruby-3.1.3
|
data/.watchr
CHANGED
@@ -33,23 +33,23 @@ end
|
|
33
33
|
def run_matching_files(base)
|
34
34
|
base = base.split("_").first
|
35
35
|
TESTING.each { |type|
|
36
|
-
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_
|
36
|
+
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*.rb/ }
|
37
37
|
run_it type, files.join(" ") unless files.empty?
|
38
38
|
}
|
39
39
|
end
|
40
40
|
|
41
41
|
TESTING.each { |type|
|
42
|
-
watch("#{type}/#{type}_helper
|
43
|
-
watch("lib
|
44
|
-
watch("#{type}/.*/*_#{type}
|
45
|
-
watch("#{type}/data/(.*)
|
42
|
+
watch("#{type}/#{type}_helper.rb") { run_all_tests }
|
43
|
+
watch("lib/.*.rb") { run_all_tests }
|
44
|
+
watch("#{type}/.*/*_#{type}.rb") { |match| run_it type, match[0] }
|
45
|
+
watch("#{type}/data/(.*).rb") { |match|
|
46
46
|
m1 = match[1]
|
47
47
|
run_matching_files("#{type}/#{m1}/#{m1}_#{type}.rb")
|
48
48
|
}
|
49
49
|
}
|
50
50
|
|
51
51
|
%w[rb erb haml slim].each { |type|
|
52
|
-
watch("app/.*/(.*)
|
52
|
+
watch("app/.*/(.*).#{type}") { |match|
|
53
53
|
run_matching_files(match[1])
|
54
54
|
}
|
55
55
|
}
|
data/Gemfile
CHANGED
@@ -4,9 +4,9 @@ gemspec
|
|
4
4
|
gem "rails"
|
5
5
|
|
6
6
|
group :test do
|
7
|
-
gem "observr"
|
8
|
-
gem "standardrb", require: false
|
9
|
-
gem "simplecov", require: false
|
10
7
|
gem "benchmark-ips"
|
8
|
+
gem "observr"
|
11
9
|
gem "ricecream"
|
10
|
+
gem "simplecov", require: false
|
11
|
+
gem "standard", require: false
|
12
12
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,72 +1,72 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
act_with_flags (3.1.
|
4
|
+
act_with_flags (3.1.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
actioncable (7.0.
|
10
|
-
actionpack (= 7.0.
|
11
|
-
activesupport (= 7.0.
|
9
|
+
actioncable (7.0.4)
|
10
|
+
actionpack (= 7.0.4)
|
11
|
+
activesupport (= 7.0.4)
|
12
12
|
nio4r (~> 2.0)
|
13
13
|
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailbox (7.0.
|
15
|
-
actionpack (= 7.0.
|
16
|
-
activejob (= 7.0.
|
17
|
-
activerecord (= 7.0.
|
18
|
-
activestorage (= 7.0.
|
19
|
-
activesupport (= 7.0.
|
14
|
+
actionmailbox (7.0.4)
|
15
|
+
actionpack (= 7.0.4)
|
16
|
+
activejob (= 7.0.4)
|
17
|
+
activerecord (= 7.0.4)
|
18
|
+
activestorage (= 7.0.4)
|
19
|
+
activesupport (= 7.0.4)
|
20
20
|
mail (>= 2.7.1)
|
21
21
|
net-imap
|
22
22
|
net-pop
|
23
23
|
net-smtp
|
24
|
-
actionmailer (7.0.
|
25
|
-
actionpack (= 7.0.
|
26
|
-
actionview (= 7.0.
|
27
|
-
activejob (= 7.0.
|
28
|
-
activesupport (= 7.0.
|
24
|
+
actionmailer (7.0.4)
|
25
|
+
actionpack (= 7.0.4)
|
26
|
+
actionview (= 7.0.4)
|
27
|
+
activejob (= 7.0.4)
|
28
|
+
activesupport (= 7.0.4)
|
29
29
|
mail (~> 2.5, >= 2.5.4)
|
30
30
|
net-imap
|
31
31
|
net-pop
|
32
32
|
net-smtp
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
|
-
actionpack (7.0.
|
35
|
-
actionview (= 7.0.
|
36
|
-
activesupport (= 7.0.
|
34
|
+
actionpack (7.0.4)
|
35
|
+
actionview (= 7.0.4)
|
36
|
+
activesupport (= 7.0.4)
|
37
37
|
rack (~> 2.0, >= 2.2.0)
|
38
38
|
rack-test (>= 0.6.3)
|
39
39
|
rails-dom-testing (~> 2.0)
|
40
40
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
41
|
-
actiontext (7.0.
|
42
|
-
actionpack (= 7.0.
|
43
|
-
activerecord (= 7.0.
|
44
|
-
activestorage (= 7.0.
|
45
|
-
activesupport (= 7.0.
|
41
|
+
actiontext (7.0.4)
|
42
|
+
actionpack (= 7.0.4)
|
43
|
+
activerecord (= 7.0.4)
|
44
|
+
activestorage (= 7.0.4)
|
45
|
+
activesupport (= 7.0.4)
|
46
46
|
globalid (>= 0.6.0)
|
47
47
|
nokogiri (>= 1.8.5)
|
48
|
-
actionview (7.0.
|
49
|
-
activesupport (= 7.0.
|
48
|
+
actionview (7.0.4)
|
49
|
+
activesupport (= 7.0.4)
|
50
50
|
builder (~> 3.1)
|
51
51
|
erubi (~> 1.4)
|
52
52
|
rails-dom-testing (~> 2.0)
|
53
53
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
54
|
-
activejob (7.0.
|
55
|
-
activesupport (= 7.0.
|
54
|
+
activejob (7.0.4)
|
55
|
+
activesupport (= 7.0.4)
|
56
56
|
globalid (>= 0.3.6)
|
57
|
-
activemodel (7.0.
|
58
|
-
activesupport (= 7.0.
|
59
|
-
activerecord (7.0.
|
60
|
-
activemodel (= 7.0.
|
61
|
-
activesupport (= 7.0.
|
62
|
-
activestorage (7.0.
|
63
|
-
actionpack (= 7.0.
|
64
|
-
activejob (= 7.0.
|
65
|
-
activerecord (= 7.0.
|
66
|
-
activesupport (= 7.0.
|
57
|
+
activemodel (7.0.4)
|
58
|
+
activesupport (= 7.0.4)
|
59
|
+
activerecord (7.0.4)
|
60
|
+
activemodel (= 7.0.4)
|
61
|
+
activesupport (= 7.0.4)
|
62
|
+
activestorage (7.0.4)
|
63
|
+
actionpack (= 7.0.4)
|
64
|
+
activejob (= 7.0.4)
|
65
|
+
activerecord (= 7.0.4)
|
66
|
+
activesupport (= 7.0.4)
|
67
67
|
marcel (~> 1.0)
|
68
68
|
mini_mime (>= 1.1.0)
|
69
|
-
activesupport (7.0.
|
69
|
+
activesupport (7.0.4)
|
70
70
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
71
71
|
i18n (>= 1.6, < 2)
|
72
72
|
minitest (>= 5.1)
|
@@ -84,92 +84,91 @@ GEM
|
|
84
84
|
thor (>= 0.14.6)
|
85
85
|
concurrent-ruby (1.1.10)
|
86
86
|
crass (1.0.6)
|
87
|
-
|
87
|
+
date (3.3.1)
|
88
88
|
docile (1.4.0)
|
89
89
|
erubi (1.11.0)
|
90
90
|
globalid (1.0.0)
|
91
91
|
activesupport (>= 5.0)
|
92
92
|
i18n (1.12.0)
|
93
93
|
concurrent-ruby (~> 1.0)
|
94
|
-
json (2.6.
|
95
|
-
|
94
|
+
json (2.6.3)
|
95
|
+
language_server-protocol (3.17.0.2)
|
96
|
+
loofah (2.19.0)
|
96
97
|
crass (~> 1.0.2)
|
97
98
|
nokogiri (>= 1.5.9)
|
98
|
-
mail (2.
|
99
|
+
mail (2.8.0)
|
99
100
|
mini_mime (>= 0.1.1)
|
101
|
+
net-imap
|
102
|
+
net-pop
|
103
|
+
net-smtp
|
100
104
|
marcel (1.0.2)
|
101
105
|
method_source (1.0.0)
|
102
106
|
mini_mime (1.1.2)
|
103
107
|
minitest (5.16.3)
|
104
|
-
net-imap (0.2
|
105
|
-
|
108
|
+
net-imap (0.3.2)
|
109
|
+
date
|
106
110
|
net-protocol
|
107
|
-
|
108
|
-
net-pop (0.1.1)
|
109
|
-
digest
|
111
|
+
net-pop (0.1.2)
|
110
112
|
net-protocol
|
113
|
+
net-protocol (0.2.1)
|
111
114
|
timeout
|
112
|
-
net-
|
113
|
-
timeout
|
114
|
-
net-smtp (0.3.1)
|
115
|
-
digest
|
115
|
+
net-smtp (0.3.3)
|
116
116
|
net-protocol
|
117
|
-
timeout
|
118
117
|
nio4r (2.5.8)
|
119
|
-
nokogiri (1.13.
|
118
|
+
nokogiri (1.13.10-x86_64-linux)
|
120
119
|
racc (~> 1.4)
|
121
120
|
observr (1.0.5)
|
122
121
|
parallel (1.22.1)
|
123
|
-
parser (3.1.
|
122
|
+
parser (3.1.3.0)
|
124
123
|
ast (~> 2.4.1)
|
125
|
-
racc (1.6.
|
124
|
+
racc (1.6.1)
|
126
125
|
rack (2.2.4)
|
127
126
|
rack-test (2.0.2)
|
128
127
|
rack (>= 1.3)
|
129
|
-
rails (7.0.
|
130
|
-
actioncable (= 7.0.
|
131
|
-
actionmailbox (= 7.0.
|
132
|
-
actionmailer (= 7.0.
|
133
|
-
actionpack (= 7.0.
|
134
|
-
actiontext (= 7.0.
|
135
|
-
actionview (= 7.0.
|
136
|
-
activejob (= 7.0.
|
137
|
-
activemodel (= 7.0.
|
138
|
-
activerecord (= 7.0.
|
139
|
-
activestorage (= 7.0.
|
140
|
-
activesupport (= 7.0.
|
128
|
+
rails (7.0.4)
|
129
|
+
actioncable (= 7.0.4)
|
130
|
+
actionmailbox (= 7.0.4)
|
131
|
+
actionmailer (= 7.0.4)
|
132
|
+
actionpack (= 7.0.4)
|
133
|
+
actiontext (= 7.0.4)
|
134
|
+
actionview (= 7.0.4)
|
135
|
+
activejob (= 7.0.4)
|
136
|
+
activemodel (= 7.0.4)
|
137
|
+
activerecord (= 7.0.4)
|
138
|
+
activestorage (= 7.0.4)
|
139
|
+
activesupport (= 7.0.4)
|
141
140
|
bundler (>= 1.15.0)
|
142
|
-
railties (= 7.0.
|
141
|
+
railties (= 7.0.4)
|
143
142
|
rails-dom-testing (2.0.3)
|
144
143
|
activesupport (>= 4.2.0)
|
145
144
|
nokogiri (>= 1.6)
|
146
145
|
rails-html-sanitizer (1.4.3)
|
147
146
|
loofah (~> 2.3)
|
148
|
-
railties (7.0.
|
149
|
-
actionpack (= 7.0.
|
150
|
-
activesupport (= 7.0.
|
147
|
+
railties (7.0.4)
|
148
|
+
actionpack (= 7.0.4)
|
149
|
+
activesupport (= 7.0.4)
|
151
150
|
method_source
|
152
151
|
rake (>= 12.2)
|
153
152
|
thor (~> 1.0)
|
154
153
|
zeitwerk (~> 2.5)
|
155
154
|
rainbow (3.1.1)
|
156
155
|
rake (13.0.6)
|
157
|
-
regexp_parser (2.
|
156
|
+
regexp_parser (2.6.1)
|
158
157
|
rexml (3.2.5)
|
159
158
|
ricecream (0.2.1)
|
160
|
-
rubocop (1.
|
159
|
+
rubocop (1.39.0)
|
161
160
|
json (~> 2.3)
|
162
161
|
parallel (~> 1.10)
|
163
162
|
parser (>= 3.1.2.1)
|
164
163
|
rainbow (>= 2.2.2, < 4.0)
|
165
164
|
regexp_parser (>= 1.8, < 3.0)
|
166
165
|
rexml (>= 3.2.5, < 4.0)
|
167
|
-
rubocop-ast (>= 1.
|
166
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
168
167
|
ruby-progressbar (~> 1.7)
|
169
168
|
unicode-display_width (>= 1.4.0, < 3.0)
|
170
|
-
rubocop-ast (1.
|
169
|
+
rubocop-ast (1.24.0)
|
171
170
|
parser (>= 3.1.1.0)
|
172
|
-
rubocop-performance (1.
|
171
|
+
rubocop-performance (1.15.1)
|
173
172
|
rubocop (>= 1.7.0, < 2.0)
|
174
173
|
rubocop-ast (>= 0.4.0)
|
175
174
|
ruby-progressbar (1.11.0)
|
@@ -179,22 +178,20 @@ GEM
|
|
179
178
|
simplecov_json_formatter (~> 0.1)
|
180
179
|
simplecov-html (0.12.3)
|
181
180
|
simplecov_json_formatter (0.1.4)
|
182
|
-
sqlite3 (1.
|
183
|
-
standard (1.
|
184
|
-
|
185
|
-
rubocop
|
186
|
-
|
187
|
-
standard
|
188
|
-
strscan (3.0.4)
|
181
|
+
sqlite3 (1.5.4-x86_64-linux)
|
182
|
+
standard (1.19.1)
|
183
|
+
language_server-protocol (~> 3.17.0.2)
|
184
|
+
rubocop (= 1.39.0)
|
185
|
+
rubocop-performance (= 1.15.1)
|
189
186
|
thor (1.2.1)
|
190
|
-
timeout (0.3.
|
187
|
+
timeout (0.3.1)
|
191
188
|
tzinfo (2.0.5)
|
192
189
|
concurrent-ruby (~> 1.0)
|
193
|
-
unicode-display_width (2.
|
190
|
+
unicode-display_width (2.3.0)
|
194
191
|
websocket-driver (0.7.5)
|
195
192
|
websocket-extensions (>= 0.1.0)
|
196
193
|
websocket-extensions (0.1.5)
|
197
|
-
zeitwerk (2.6.
|
194
|
+
zeitwerk (2.6.6)
|
198
195
|
|
199
196
|
PLATFORMS
|
200
197
|
x86_64-linux
|
@@ -212,7 +209,7 @@ DEPENDENCIES
|
|
212
209
|
ricecream
|
213
210
|
simplecov
|
214
211
|
sqlite3
|
215
|
-
|
212
|
+
standard
|
216
213
|
|
217
214
|
BUNDLED WITH
|
218
|
-
2.3.
|
215
|
+
2.3.26
|
data/README.md
CHANGED
@@ -125,6 +125,7 @@ Further reading:
|
|
125
125
|
- [gem active_flag](https://github.com/kenn/active_flag)
|
126
126
|
- [gem has-bit-field](https://github.com/pjb3/has-bit-field)
|
127
127
|
- [gem bitfield_attribute](https://github.com/gzigzigzeo/bitfield_attribute)
|
128
|
+
- [gem bitwise](https://github.com/kenn/bitwise)
|
128
129
|
|
129
130
|
|
130
131
|
## License MIT
|
data/test/any_all_none_test.rb
CHANGED
data/test/benchmark_test.rb
CHANGED
@@ -6,8 +6,8 @@ require "benchmark"
|
|
6
6
|
require "benchmark/ips"
|
7
7
|
# ENV["MORE"] = "true"
|
8
8
|
|
9
|
-
describe "Internal timings
|
10
|
-
let(:order) { Order.
|
9
|
+
describe "Internal timings" do
|
10
|
+
let(:order) { Order.new }
|
11
11
|
|
12
12
|
def setup
|
13
13
|
reset_order
|
@@ -30,7 +30,7 @@ describe "Internal timings flag" do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe "Internal timings mask" do
|
33
|
-
let(:order) { Order.
|
33
|
+
let(:order) { Order.new }
|
34
34
|
let(:admin) { Order.act_with_flags }
|
35
35
|
|
36
36
|
def setup
|
@@ -62,7 +62,7 @@ class BenchFoo < Minitest::Benchmark
|
|
62
62
|
n = 100_000
|
63
63
|
n = 10_000
|
64
64
|
Order.add_to_flags :blocked2
|
65
|
-
order = Order.
|
65
|
+
order = Order.new
|
66
66
|
assert_performance_constant do |input|
|
67
67
|
n.times do
|
68
68
|
order.blocked2 = true
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
-
describe "Internal check
|
4
|
-
let(:order) { Order.
|
3
|
+
describe "Internal check add_to_" do
|
4
|
+
let(:order) { Order.new }
|
5
5
|
|
6
6
|
def setup
|
7
7
|
reset_order
|
8
8
|
Order.add_to_flags a: 1, b: 7
|
9
9
|
end
|
10
10
|
|
11
|
-
it "
|
11
|
+
it "skips reserved position" do
|
12
12
|
Order.add_to_flags :xx
|
13
13
|
order.xx = true
|
14
14
|
assert_equal 0x100, order.flags
|
data/test/coding_null_test.rb
CHANGED
data/test/coding_one_test.rb
CHANGED
@@ -10,14 +10,14 @@ describe "Internal One Flag" do
|
|
10
10
|
Order.add_to_flags flag
|
11
11
|
end
|
12
12
|
|
13
|
-
it "test order.
|
13
|
+
it "test order.act_with_" do
|
14
14
|
refute_nil admin
|
15
15
|
assert_equal admin, order.class.act_with_flags
|
16
16
|
assert_equal admin, order.act_with_flags
|
17
17
|
assert_equal admin, Order.act_with_flags
|
18
18
|
end
|
19
19
|
|
20
|
-
it "checks definition of methods
|
20
|
+
it "checks definition of methods" do
|
21
21
|
msg = "method '#{flag}' not defined"
|
22
22
|
assert order.respond_to?(flag.to_s), msg
|
23
23
|
assert order.respond_to?("#{flag}?"), msg
|
data/test/legacy_test.rb
CHANGED
data/test/null_test.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
3
|
describe "No Flags" do
|
4
|
+
let(:order) { Order.new }
|
5
|
+
|
4
6
|
def setup
|
5
7
|
reset_order
|
6
8
|
Order.add_to_flags
|
@@ -12,4 +14,11 @@ describe "No Flags" do
|
|
12
14
|
assert Order.respond_to?(:clear_flags_at_save)
|
13
15
|
assert Order.respond_to?(:act_with_flags)
|
14
16
|
end
|
17
|
+
|
18
|
+
it "checks mask et all; no parameters" do
|
19
|
+
assert_equal 0, order.flags_mask
|
20
|
+
refute order.flags_any?
|
21
|
+
assert order.flags_all?
|
22
|
+
assert order.flags_none?
|
23
|
+
end
|
15
24
|
end
|
data/test/one_test.rb
CHANGED
@@ -2,14 +2,20 @@ require "test_helper"
|
|
2
2
|
|
3
3
|
describe "One Flag" do
|
4
4
|
let(:flag) { :blocked }
|
5
|
-
let(:order) { Order.
|
5
|
+
let(:order) { Order.new }
|
6
6
|
|
7
7
|
def setup
|
8
8
|
reset_order
|
9
9
|
Order.add_to_flags flag
|
10
10
|
end
|
11
11
|
|
12
|
-
it "
|
12
|
+
it "checks defaults" do
|
13
|
+
refute_equal true, order.blocked
|
14
|
+
assert_equal false, order.blocked
|
15
|
+
assert_equal false, order.blocked?
|
16
|
+
end
|
17
|
+
|
18
|
+
it "set :blocked" do
|
13
19
|
order.blocked = true
|
14
20
|
assert_equal true, order.blocked
|
15
21
|
assert_equal true, order.blocked?
|
data/test/range_test.rb
CHANGED
@@ -47,43 +47,4 @@ describe "range" do
|
|
47
47
|
it "tests range ...0 no position" do
|
48
48
|
assert_raises(RangeError) { Order.add_to_flags :a, range: ...0 }
|
49
49
|
end
|
50
|
-
|
51
|
-
# YAGNI
|
52
|
-
# # includes range: ( .. 3 ) equivalent to range: ..3
|
53
|
-
# n = 100
|
54
|
-
# (0..n).each do |i|
|
55
|
-
# rng = ..i
|
56
|
-
#
|
57
|
-
# (0..i).each do |j|
|
58
|
-
# it "tests range ..#{i} with position #{j}" do
|
59
|
-
# Order.add_to_flags a: j, range: rng
|
60
|
-
# end
|
61
|
-
# end
|
62
|
-
#
|
63
|
-
# it "fails range ..#{i} with position overflow" do
|
64
|
-
# assert_raises(RangeError) { Order.add_to_flags b: (i + 1), range: rng }
|
65
|
-
# end
|
66
|
-
# end
|
67
|
-
#
|
68
|
-
# it "runs ii plus" do
|
69
|
-
# ii = 0
|
70
|
-
# (0..2).each { |íí|
|
71
|
-
# sym = "x#{ii}".to_sym
|
72
|
-
# j = f(ii, ii + 1) # filler
|
73
|
-
# rand j
|
74
|
-
# Order.add_to_flags :range => ii..f(íí, íí), sym => (ii += 1)
|
75
|
-
# orden = Order.new
|
76
|
-
# refute orden.send("#{sym}?") # checks that accessor is active
|
77
|
-
# orden.x0 = true # checks that first accessor is still there
|
78
|
-
# assert orden.x0?
|
79
|
-
# }
|
80
|
-
# end
|
81
|
-
#
|
82
|
-
# private
|
83
|
-
#
|
84
|
-
# def f(x, y)
|
85
|
-
# return y + 1 if x == 0
|
86
|
-
# return f(x - 1, 1) if y == 0
|
87
|
-
# f(x - 1, f(x, y - 1))
|
88
|
-
# end
|
89
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: act_with_flags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -101,6 +101,7 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- ".github/workflows/lint.yml"
|
104
105
|
- ".github/workflows/rake.yml"
|
105
106
|
- ".gitignore"
|
106
107
|
- ".ruby-gemset"
|
@@ -177,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
178
|
- !ruby/object:Gem::Version
|
178
179
|
version: '0'
|
179
180
|
requirements: []
|
180
|
-
rubygems_version: 3.3.
|
181
|
+
rubygems_version: 3.3.26
|
181
182
|
signing_key:
|
182
183
|
specification_version: 4
|
183
184
|
summary: act_with_flags gem
|