act_with_booleans 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +11 -16
- data/.gitignore +1 -0
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/Gemfile +3 -2
- data/MIT-LICENSE +3 -1
- data/README.md +6 -7
- data/act_with_booleans.gemspec +1 -2
- data/lib/act_with_booleans/version.rb +3 -1
- data/test/benchmark_test.rb +1 -1
- data/test/coding_check_add_test.rb +1 -1
- data/test/coding_coverage_test.rb +4 -1
- data/test/coding_one_test.rb +2 -2
- data/test/one_test.rb +2 -2
- metadata +5 -8
- data/.github/workflows/lint.yml +0 -16
- data/.watchr +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a1762002b1c5d4f306f6a8e12e45fdec641ad0efba59e5c73a4882a9331e410
|
4
|
+
data.tar.gz: 3ac016617687d41dc3c84f90c39486a25b278f6f8dc7434220b50f6d4d5ab7cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 052e9ab681b552860948a481df24e3ce16462034983d6bc8a535292e8f0564fbf0119e99d8ad2cf55a288e2d156e1b725136045704effa5b41699602f3244278
|
7
|
+
data.tar.gz: ca371c13cafa8fcfc9ec5f38f232eb795db3aa850f601fe65cf5655db7a52f1dc1d72e95323df78f62fb499ae7f5cafb0e396069ca346ee457d838c16030d39a
|
data/.github/workflows/rake.yml
CHANGED
@@ -1,27 +1,22 @@
|
|
1
1
|
# see also https://github.com/whitequark/parser/blob/master/.github/workflows/test.yml
|
2
2
|
name: Rake
|
3
3
|
|
4
|
-
on: push
|
4
|
+
on: [push]
|
5
5
|
|
6
6
|
jobs:
|
7
7
|
test:
|
8
8
|
strategy:
|
9
9
|
fail-fast: false
|
10
10
|
matrix:
|
11
|
-
|
12
|
-
|
13
|
-
ruby: [3.0.0, head]
|
14
|
-
test_command: ["bundle exec rake test"]
|
15
|
-
runs-on: ${{ matrix.os }}
|
11
|
+
ruby_version: ["3.0", 3.2]
|
12
|
+
runs-on: ubuntu-latest
|
16
13
|
|
17
14
|
steps:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
bundle
|
26
|
-
bundle update
|
27
|
-
- run: ${{ matrix.test_command }}
|
15
|
+
- uses: actions/checkout@v3
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ${{ matrix.ruby_version }}
|
20
|
+
bundler-cache: true
|
21
|
+
- name: Build and test with Rake
|
22
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails-7.
|
1
|
+
rails-7.1
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-3.
|
1
|
+
ruby-3.2.2
|
data/Gemfile
CHANGED
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
#
|
1
|
+
# ActWithBooleans
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/act_with_booleans.png)](http://badge.fury.io/rb/act_with_booleans)
|
4
|
+
[![GEM Downloads](https://img.shields.io/gem/dt/act_with_booleans?color=168AFE&logo=ruby&logoColor=FE1616)](https://rubygems.org/gems/act_with_booleans)
|
4
5
|
|
5
6
|
A Ruby gem handling booleans placed in an integer.
|
6
7
|
|
7
8
|
Defines setters and getters to access the booleans.
|
8
9
|
|
9
|
-
|
10
10
|
## Installation
|
11
11
|
|
12
12
|
As usual:
|
@@ -14,6 +14,7 @@ As usual:
|
|
14
14
|
# Gemfile
|
15
15
|
gem "act_with_booleans"
|
16
16
|
```
|
17
|
+
and run "bundle install".
|
17
18
|
|
18
19
|
## Examples
|
19
20
|
|
@@ -112,9 +113,7 @@ Further reading:
|
|
112
113
|
- [gem bitwise](https://github.com/kenn/bitwise)
|
113
114
|
|
114
115
|
|
115
|
-
##
|
116
|
-
|
117
|
-
Copyright (c) 2022 [Dittmar Krall](matiq UG (haftungsbeschränkt))
|
118
|
-
and is released under the MIT license:
|
116
|
+
## Miscellaneous
|
119
117
|
|
120
|
-
|
118
|
+
Copyright (c) 2023 Dittmar Krall (www.matiq.com),
|
119
|
+
released under the [MIT license](https://opensource.org/licenses/MIT).
|
data/act_with_booleans.gemspec
CHANGED
@@ -9,11 +9,10 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.description = %(Handles booleans packed in an integer)
|
10
10
|
s.authors = ["Dittmar Krall"]
|
11
11
|
s.email = ["dittmar.krall@matiq.com"]
|
12
|
-
s.homepage = "
|
12
|
+
s.homepage = "https://github.com/matique/act_with_booleans"
|
13
13
|
|
14
14
|
s.license = "MIT"
|
15
15
|
s.platform = Gem::Platform::RUBY
|
16
|
-
s.metadata["source_code_uri"] = "https://github.com/matique/act_with_booleans"
|
17
16
|
|
18
17
|
s.files = `git ls-files -z`.split("\x0")
|
19
18
|
s.require_paths = ["lib"]
|
data/test/benchmark_test.rb
CHANGED
@@ -10,10 +10,13 @@ describe "Coverage" do
|
|
10
10
|
|
11
11
|
it "coverage to_s" do
|
12
12
|
res = order.act_with_booleans.to_s
|
13
|
-
# puts res
|
14
13
|
puts res if ENV["MORE"]
|
15
14
|
end
|
16
15
|
|
16
|
+
it "coverage location raise" do
|
17
|
+
assert_raises { order.act_with_flags.location(:unknown) }
|
18
|
+
end
|
19
|
+
|
17
20
|
it "coverage position" do
|
18
21
|
assert_equal 1, order.act_with_booleans.position(:a)
|
19
22
|
assert_equal 7, Order.act_with_booleans.position(:b)
|
data/test/coding_one_test.rb
CHANGED
@@ -10,14 +10,14 @@ describe "Internal One Flag" do
|
|
10
10
|
Order.add_to_booleans bool
|
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_booleans
|
16
16
|
assert_equal admin, order.act_with_booleans
|
17
17
|
assert_equal admin, Order.act_with_booleans
|
18
18
|
end
|
19
19
|
|
20
|
-
it "checks definition of methods
|
20
|
+
it "checks definition of methods" do
|
21
21
|
msg = "method '#{bool}' not defined"
|
22
22
|
assert order.respond_to?(bool.to_s), msg
|
23
23
|
assert order.respond_to?("#{bool}?"), msg
|
data/test/one_test.rb
CHANGED
@@ -9,13 +9,13 @@ describe "One Flag" do
|
|
9
9
|
Order.add_to_booleans bool
|
10
10
|
end
|
11
11
|
|
12
|
-
it "checks
|
12
|
+
it "checks defaults" do
|
13
13
|
refute_equal true, order.blocked
|
14
14
|
assert_equal false, order.blocked
|
15
15
|
assert_equal false, order.blocked?
|
16
16
|
end
|
17
17
|
|
18
|
-
it "set
|
18
|
+
it "set :blocked" do
|
19
19
|
order.blocked = true
|
20
20
|
assert_equal true, order.blocked
|
21
21
|
assert_equal true, order.blocked?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: act_with_booleans
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,12 +59,10 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- ".github/workflows/lint.yml"
|
63
62
|
- ".github/workflows/rake.yml"
|
64
63
|
- ".gitignore"
|
65
64
|
- ".ruby-gemset"
|
66
65
|
- ".ruby-version"
|
67
|
-
- ".watchr"
|
68
66
|
- Gemfile
|
69
67
|
- MIT-LICENSE
|
70
68
|
- README.md
|
@@ -92,11 +90,10 @@ files:
|
|
92
90
|
- test/origin_test.rb
|
93
91
|
- test/size_test.rb
|
94
92
|
- test/test_helper.rb
|
95
|
-
homepage:
|
93
|
+
homepage: https://github.com/matique/act_with_booleans
|
96
94
|
licenses:
|
97
95
|
- MIT
|
98
|
-
metadata:
|
99
|
-
source_code_uri: https://github.com/matique/act_with_booleans
|
96
|
+
metadata: {}
|
100
97
|
post_install_message:
|
101
98
|
rdoc_options: []
|
102
99
|
require_paths:
|
@@ -112,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
109
|
- !ruby/object:Gem::Version
|
113
110
|
version: '0'
|
114
111
|
requirements: []
|
115
|
-
rubygems_version: 3.
|
112
|
+
rubygems_version: 3.4.20
|
116
113
|
signing_key:
|
117
114
|
specification_version: 4
|
118
115
|
summary: Ruby gem act_with_booleans
|
data/.github/workflows/lint.yml
DELETED
@@ -1,16 +0,0 @@
|
|
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
|
15
|
-
# - name: Run erb-lint
|
16
|
-
# run: bundle exec erblint --lint-all
|
data/.watchr
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
TESTING = %w[test]
|
2
|
-
HH = "#" * 22 unless defined?(HH)
|
3
|
-
H = "#" * 5 unless defined?(H)
|
4
|
-
|
5
|
-
def usage
|
6
|
-
puts <<-EOS
|
7
|
-
Ctrl-\\ or ctrl-4 Running all tests
|
8
|
-
Ctrl-C Exit
|
9
|
-
EOS
|
10
|
-
end
|
11
|
-
|
12
|
-
def run(cmd)
|
13
|
-
puts "#{HH} #{Time.now} #{HH}"
|
14
|
-
puts "#{H} #{cmd}"
|
15
|
-
system "/usr/bin/time --format '#{HH} Elapsed time %E' #{cmd}"
|
16
|
-
end
|
17
|
-
|
18
|
-
def run_it(type, files)
|
19
|
-
files.split(" ").flatten.each do |file|
|
20
|
-
case type
|
21
|
-
when "test" then run %(bundle exec ruby -I test #{file})
|
22
|
-
# when 'spec'; run %(rspec -X #{file})
|
23
|
-
else; puts "#{H} unknown type: #{type}, file: #{file}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def run_all_tests
|
29
|
-
puts "\n#{HH} Running all tests #{HH}\n"
|
30
|
-
TESTING.each { |dir| run "bundle exec rake #{dir}" if File.exist?(dir) }
|
31
|
-
end
|
32
|
-
|
33
|
-
def run_matching_files(base)
|
34
|
-
base = base.split("_").first
|
35
|
-
TESTING.each { |type|
|
36
|
-
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*.rb/ }
|
37
|
-
run_it type, files.join(" ") unless files.empty?
|
38
|
-
}
|
39
|
-
end
|
40
|
-
|
41
|
-
TESTING.each { |type|
|
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
|
-
m1 = match[1]
|
47
|
-
run_matching_files("#{type}/#{m1}/#{m1}_#{type}.rb")
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
%w[rb erb haml slim].each { |type|
|
52
|
-
watch("app/.*/(.*).#{type}") { |match|
|
53
|
-
run_matching_files(match[1])
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
# Ctrl-\ or ctrl-4
|
58
|
-
Signal.trap("QUIT") { run_all_tests }
|
59
|
-
# Ctrl-C
|
60
|
-
Signal.trap("INT") { abort("Interrupted\n") }
|
61
|
-
usage
|