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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ff0e9f9dd9b6904d92a893cc073253e94c4972cd4bf2a3192c9a32b0036a6ad
4
- data.tar.gz: 75d84e166a9057378d55929fd279c3af9f52909d394c947c1153a3ed1b033ea1
3
+ metadata.gz: 3a1762002b1c5d4f306f6a8e12e45fdec641ad0efba59e5c73a4882a9331e410
4
+ data.tar.gz: 3ac016617687d41dc3c84f90c39486a25b278f6f8dc7434220b50f6d4d5ab7cd
5
5
  SHA512:
6
- metadata.gz: 99b35188502f608a687db95c7b9aee03277169838703b1fbce3e651f7c6d823b797cb385b2f04a32dceaa0022ca2737256ed9142a5b729a72c7ed82b5737acb2
7
- data.tar.gz: eb14fa56c77c35c9b52a6bab3e1cc47a91d04c1e460c27ef4582300c832d28bcd94f87f1e7a6211ae5b87bcac10014423dad98307df2e6e4ee81b767faca287f
6
+ metadata.gz: 052e9ab681b552860948a481df24e3ce16462034983d6bc8a535292e8f0564fbf0119e99d8ad2cf55a288e2d156e1b725136045704effa5b41699602f3244278
7
+ data.tar.gz: ca371c13cafa8fcfc9ec5f38f232eb795db3aa850f601fe65cf5655db7a52f1dc1d72e95323df78f62fb499ae7f5cafb0e396069ca346ee457d838c16030d39a
@@ -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
- 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]
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
- - uses: actions/checkout@v2
19
- - uses: ruby/setup-ruby@v1
20
- with:
21
- ruby-version: ${{ matrix.ruby }}
22
- - name: Bundle install
23
- run: |
24
- bundle config path /home/runner/bundle
25
- bundle install
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
@@ -1,5 +1,6 @@
1
1
  .bundle/
2
2
  coverage/
3
+ .watchr
3
4
 
4
5
  *.gem
5
6
  *.log
data/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- rails-7.0
1
+ rails-7.1
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
@@ -1,12 +1,12 @@
1
- # ActWithFlags
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
- ## License MIT
116
-
117
- Copyright (c) 2022 [Dittmar Krall](matiq UG (haftungsbeschränkt))
118
- and is released under the MIT license:
116
+ ## Miscellaneous
119
117
 
120
- * https://opensource.org/licenses/MIT
118
+ Copyright (c) 2023 Dittmar Krall (www.matiq.com),
119
+ released under the [MIT license](https://opensource.org/licenses/MIT).
@@ -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 = "http://matiq.com"
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"]
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActWithBooleans
4
- VERSION = "0.0.2" # 2022-12-11
4
+ VERSION = "0.0.4" # 2023-12-11
5
+ # VERSION = "0.0.3" # 2023-04-23
6
+ # VERSION = "0.0.2" # 2022-12-11
5
7
  # VERSION = "0.0.1" # 2022-09-10
6
8
  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.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: 2022-12-11 00:00:00.000000000 Z
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: http://matiq.com
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.3.26
112
+ rubygems_version: 3.4.20
116
113
  signing_key:
117
114
  specification_version: 4
118
115
  summary: Ruby gem act_with_booleans
@@ -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