act_with_booleans 0.0.2 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ff0e9f9dd9b6904d92a893cc073253e94c4972cd4bf2a3192c9a32b0036a6ad
4
- data.tar.gz: 75d84e166a9057378d55929fd279c3af9f52909d394c947c1153a3ed1b033ea1
3
+ metadata.gz: c4640236fbfd6a32e80383d4fc9d9ede303c9abdf17c50007fca2f6ffbf5f824
4
+ data.tar.gz: 123d982d723a4ea0a140d6924f1f2afd7808940c36309e0e549415a19e84a43e
5
5
  SHA512:
6
- metadata.gz: 99b35188502f608a687db95c7b9aee03277169838703b1fbce3e651f7c6d823b797cb385b2f04a32dceaa0022ca2737256ed9142a5b729a72c7ed82b5737acb2
7
- data.tar.gz: eb14fa56c77c35c9b52a6bab3e1cc47a91d04c1e460c27ef4582300c832d28bcd94f87f1e7a6211ae5b87bcac10014423dad98307df2e6e4ee81b767faca287f
6
+ metadata.gz: '01794525018fc50a09c582f450e9f30190d567633d7ea32cd0d000df00e09ba80f962f9ba2479a0759f0864b8b1adbfe6db5ca0de57a4e728438ba2045775c5b'
7
+ data.tar.gz: fc8efd57e21adfac8ee480efb4537920ae92972ca0f7090cd159afdfc0db3e9d9c3d3039923e26906bb06a31cc8bd9283028dbae898a5fc37e639c75b0a0ca55
@@ -5,12 +5,10 @@ jobs:
5
5
  runs-on: ubuntu-latest
6
6
  steps:
7
7
  - name: Checkout code
8
- uses: actions/checkout@v2
8
+ uses: actions/checkout@v3
9
9
  - name: Set up Ruby
10
10
  uses: ruby/setup-ruby@v1
11
11
  with:
12
12
  bundler-cache: true
13
13
  - name: Run Standard
14
14
  run: bundle exec standardrb
15
- # - name: Run erb-lint
16
- # run: bundle exec erblint --lint-all
@@ -1,7 +1,7 @@
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:
@@ -9,13 +9,12 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  os: [ubuntu-latest]
12
- # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
13
- ruby: [3.0.0, head]
12
+ ruby: ["2.7", "3.0", "3.2", head]
14
13
  test_command: ["bundle exec rake test"]
15
14
  runs-on: ${{ matrix.os }}
16
15
 
17
16
  steps:
18
- - uses: actions/checkout@v2
17
+ - uses: actions/checkout@v3
19
18
  - uses: ruby/setup-ruby@v1
20
19
  with:
21
20
  ruby-version: ${{ matrix.ruby }}
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-3.1.3
1
+ ruby-3.2.2
data/Gemfile CHANGED
@@ -2,8 +2,9 @@ source "https://rubygems.org"
2
2
  gemspec
3
3
 
4
4
  group :test do
5
+ gem "benchmark-ips"
5
6
  gem "observr"
6
- gem "standard", require: false
7
+ gem "ricecream"
7
8
  gem "simplecov", require: false
8
- gem "benchmark-ips"
9
+ gem "standard", require: false
9
10
  end
data/MIT-LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright 2022 Dittmar Krall - www.matiq.com
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022-2023 Dittmar Krall (www.matiq.com)
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -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,9 @@ Further reading:
112
113
  - [gem bitwise](https://github.com/kenn/bitwise)
113
114
 
114
115
 
115
- ## License MIT
116
+ ## Miscellaneous
116
117
 
117
- Copyright (c) 2022 [Dittmar Krall](matiq UG (haftungsbeschränkt))
118
- and is released under the MIT license:
118
+ Copyright (c) 2023 Dittmar Krall (www.matiq.com),
119
+ released under the MIT license:
119
120
 
120
121
  * https://opensource.org/licenses/MIT
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActWithBooleans
4
- VERSION = "0.0.2" # 2022-12-11
4
+ VERSION = "0.0.3" # 2023-04-23
5
+ # VERSION = "0.0.2" # 2022-12-11
5
6
  # VERSION = "0.0.1" # 2022-09-10
6
7
  end
@@ -6,7 +6,7 @@ require "benchmark"
6
6
  require "benchmark/ips"
7
7
  # ENV["MORE"] = "true"
8
8
 
9
- describe "Internal timings boolean" do
9
+ describe "Internal timings" do
10
10
  let(:order) { Order.new }
11
11
 
12
12
  def setup
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- describe "Internal check add boolean" do
3
+ describe "Internal check add_to_booleans" do
4
4
  let(:order) { Order.new }
5
5
 
6
6
  def setup
@@ -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)
@@ -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.act_with_booleans" do
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 for bool" do
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 bool default" do
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 bool (:blocked)" do
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.2
4
+ version: 0.0.3
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-12-11 00:00:00.000000000 Z
11
+ date: 2023-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,7 +64,6 @@ files:
64
64
  - ".gitignore"
65
65
  - ".ruby-gemset"
66
66
  - ".ruby-version"
67
- - ".watchr"
68
67
  - Gemfile
69
68
  - MIT-LICENSE
70
69
  - README.md
@@ -112,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
111
  - !ruby/object:Gem::Version
113
112
  version: '0'
114
113
  requirements: []
115
- rubygems_version: 3.3.26
114
+ rubygems_version: 3.4.10
116
115
  signing_key:
117
116
  specification_version: 4
118
117
  summary: Ruby gem act_with_booleans
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