limit_detectors 0.1.2 → 1.0.3

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: '0852bf97988e298be4ee0de60d93406f5524af6acff2442a7908164601a18444'
4
- data.tar.gz: f4a20cb0eb2acbbcb55adaaeaa0e41bee8c7c9a230e8d0b0601b156a61455bfc
3
+ metadata.gz: a9c4c660f15ecc4e816cdebadb1526ef80deff9185eb7bc00d509b3494c2fb61
4
+ data.tar.gz: 394f7bd5b3171993ac9b3c41b64fe816e4d636c44ea94c4b21c66b806aec7928
5
5
  SHA512:
6
- metadata.gz: a4886911b3f7e4678ede7807c02ee12c4f7bccbd2a79fa7b75857a6a9f354235091e687ef33fc75785e38da491275c84f82b8128756246b148cd60018e47180e
7
- data.tar.gz: 024db8b7988586d55251897e6f26f7a7a2724bb613afc3ba5ab7bd971fb9db97fce43e42a2666f362b9f3f72033151525913c13db54fcd12a0f76b39ff478434
6
+ metadata.gz: 7cb70eefb851d36d20ea4b0702c860d879e720adccde22aeaa25ca9842fd5f8a262c7c5a3bfb2d862df6dcb201b1dc41dc75cd7bba44020a27eef487c57b7891
7
+ data.tar.gz: 7094529925df0e522da2fe89640452086fd07d2256edae4adef0f70aa19f4159a431eef071bb6c37a5e30428bb0a41830cb68d3d506d02a8662f04adb7afa4eb
@@ -0,0 +1,32 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ main ]
13
+ pull_request:
14
+ branches: [ main ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.7', '3.0', '3.1', 'jruby', 'truffleruby']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
+ - name: Run tests
32
+ run: bundle exec rake
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --color
2
2
  --format documentation
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ Exclude:
4
+ - 'bin/**/*'
5
+
6
+ Style/EmptyMethod:
7
+ Enabled: false
8
+
data/Gemfile CHANGED
@@ -1,13 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in limit_detectors.gemspec
4
6
  gemspec
5
-
6
-
7
- # To support Rubinius on Travis-CI
8
- platforms :rbx do
9
- gem 'racc'
10
- gem 'minitest'
11
- gem 'rubysl'#, '~> 2.0'
12
- gem 'psych'
13
- end
data/README.md CHANGED
@@ -4,12 +4,12 @@ Some methods to detect whether an Enumberable object contains a constrained numb
4
4
 
5
5
  A second reason to create this gem is to explore various other services -- see the status list below.
6
6
 
7
- ## Stati
7
+
8
+ ## Status & Links
8
9
 
9
10
  * Version: [![Gem Version](https://badge.fury.io/rb/limit_detectors.svg)](http://badge.fury.io/rb/limit_detectors)
10
- * Travis CI: [![Build Status](https://travis-ci.org/s2k/limit_detectors.svg?branch=master)](https://travis-ci.org/s2k/limit_detectors)
11
- * Code Climate: [![Code Climate](https://codeclimate.com/github/s2k/limit_detectors.png)](https://codeclimate.com/github/s2k/limit_detectors)
12
- * Circle CI: [![Circle CI](https://circleci.com/gh/s2k/limit_detectors.svg?style=svg)](https://circleci.com/gh/s2k/limit_detectors)
11
+ * GitHub Actions: [![Main workflow: unit tests](https://github.com/s2k/limit_detectors/actions/workflows/ruby.yml/badge.svg)](https://github.com/s2k/limit_detectors/actions)
12
+ * Code Climate: [![Maintainability](https://api.codeclimate.com/v1/badges/f29deb5bcd4e2ad44d25/maintainability)](https://codeclimate.com/github/s2k/limit_detectors/maintainability)
13
13
 
14
14
 
15
15
  ## Installation
@@ -26,54 +26,84 @@ Or install it yourself as:
26
26
 
27
27
  $ gem install limit_detectors
28
28
 
29
+
29
30
  ## Usage
30
31
 
31
- In your code you can `require 'limit_detectors'` then define you classes (or use built-in classes like Array, Hash
32
- or other enumerable objects), extend these objects with LimitDetectors (or include the module in your class) and
33
- then call `at_most?` (or àt_least?') on your object.
32
+ In your code, you can `require 'limit_detectors'` then define your classes and `include` module `LimitDetectors` in your class, or create enumerable objects and `extend` these objects with `LimitDetectors`. Then call `at_most?` (or `t_least?`) on your object.
34
33
 
35
- For example:
34
+ For example using `pry`(you can use `irb` as well) you can do this:
36
35
 
37
- $pry -I lib -r limit_detectors
38
- [1] pry(main)> a = [1, 2, 3, 4, 5]
39
- => [1, 2, 3, 4, 5]
40
- [2] pry(main)> a.extend LimitDetectors
41
- => [1, 2, 3, 4, 5]
42
- [3] pry(main)> a.at_most?(4){|e| e.odd?}
43
- => true # There are indeed no more than 4 odd numbers in the array
44
- [4] pry(main)> a.at_most?(1){|e| e.even?}
45
- => false # In fact there are two even numbers in the array
36
+ ```ruby
37
+ [3] pry(main)> a.at_most?(4){|e| e.odd?}
38
+ => true # There are indeed no more than 4 odd numbers in the array
39
+ [4] pry(main)> a.at_most?(1){|e| e.even?}
40
+ => false # In fact there are two even numbers in the array
46
41
 
47
- ## Compatibility
42
+ $ pry -I lib -r limit_detectors
43
+ [1] pry(main)> a = [1, 2, 3, 4, 5]
44
+ => [1, 2, 3, 4, 5]
45
+ [2] pry(main)> a.extend LimitDetectors
46
+ => [1, 2, 3, 4, 5]
47
+ [3] pry(main)> a.at_most?(4){|e| e.odd?}
48
+ => true # There are indeed no more than 4 odd numbers in the array
49
+ [4] pry(main)> a.at_most?(4, &:odd?)
50
+ => true # The same behaviour using a different notation
51
+ [5] pry(main)> a.at_most?(1){|e| e.even?}
52
+ => false # In fact there are two even numbers in the array
53
+ ```
54
+
55
+ In code the usage may look like this (see example/example.rb for the file):
56
+
57
+ ```ruby
58
+ require 'limit_detectors'
59
+
60
+ class Example
61
+ include Enumerable
62
+ def each
63
+ ('a'..'d').each { |c| yield c }
64
+ end
65
+ end
66
+
67
+ e = Example.new
68
+ e.extend LimitDetectors
48
69
 
49
- Please note the current version of 0.0.something, which means the future releases
50
- may not be compatible with the current version.
70
+
71
+ puts e.at_least?(1) { |c| 'f' == c }
72
+ puts e.at_least?(1) { |c| 'b' == c }
73
+ puts e.at_most?(0) { |c| 'b' == c }
74
+ puts e.at_most?(42) { |c| 'b' == c }
75
+ ```
76
+
77
+
78
+ ## Compatibility
51
79
 
52
80
  This gem is tested with these Ruby versions (MRI, unless JRuby):
53
81
 
54
- - 2.1.10
55
- - 2.2.7
56
- - 2.3.4
57
- - 2.4.1
82
+ - 2.7
83
+ - 3.0
84
+ - 3.1
58
85
 
59
- as well as a current version of JRuby.
86
+ as well as a current version of JRuby and TruffleRuby
60
87
 
61
88
  ## Contributing
62
89
 
63
- 1. Fork it ( https://github.com/[my-github-username]/limit_detectors/fork )
90
+ 1. Fork it ( https://github.com/[my-github-username]/limit_detectors/fork)
64
91
  2. Create your feature branch (`git checkout -b my-new-feature`)
65
92
  3. Commit your changes (`git commit -am 'Add some feature'`)
66
93
  4. Push to the branch (`git push origin my-new-feature`)
67
94
  5. Create a new Pull Request
68
95
 
96
+ A more detailed description is at https://opensource.com/article/19/7/create-pull-request-github
97
+
98
+
69
99
  ### Reporting a bug
70
100
 
71
101
  Please, provide answers to the following questions, when submitting a bug report:
72
102
 
73
- 1. What's actually happening? What the observed behaviour?
74
- 2. What's the expectation, i.e. what should have happened?
103
+ 1. What's _actually_ happening? What is the observed behaviour?
104
+ 2. What's the _expectation_, i.e. what should have happened?
75
105
  3. Why did you expect this behaviour?
76
106
 
77
- If you provide an RSpec check that demonstrates the bug, would give extra good karma,
107
+ If you provide an `RSpec` check that demonstrates the bug, would give extra good karma,
78
108
  especially in case of a minimal check, something that just demonstrates the bug without
79
109
  any (or much) overhead.
data/Rakefile CHANGED
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
4
6
  RSpec::Core::RakeTask.new :spec
5
7
 
6
- task :default => :spec
8
+ task default: :spec
7
9
 
8
10
  task :console do
9
11
  exec 'irb -I ./lib -r limit_detectors'
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'limit_detectors'
4
+
5
+ class Example
6
+ include Enumerable
7
+ def each(&block)
8
+ ('a'..'d').each(&block)
9
+ end
10
+ end
11
+
12
+ e = Example.new
13
+ e.extend LimitDetectors
14
+
15
+ puts e.at_least?(1) { |c| c == 'f' }
16
+ puts e.at_least?(1) { |c| c == 'b' }
17
+ puts e.at_most?(0) { |c| c == 'b' }
18
+ puts e.at_most?(42) { |c| c == 'b' }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module LimitDetectors
2
- VERSION = '0.1.2'
4
+ VERSION = '1.0.3'
3
5
  end
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'limit_detectors/version'
2
4
 
3
5
  module LimitDetectors
4
-
5
6
  # Deprecated, use at_most? instead
6
7
  def at_most(limit, &block)
7
8
  Kernel.warn "'at_most' is deprecated, use 'at_most?' instead"
@@ -17,22 +18,21 @@ module LimitDetectors
17
18
  # Check whether the condition given in the block
18
19
  # occurs at most limit times in the collection
19
20
  def at_most?(limit, &block)
20
- ocurrences_of(&block) <= limit
21
+ occurrences_of(&block) <= limit
21
22
  end
22
23
 
23
24
  # Check whether the condition given in the block
24
25
  # occurs at least limit times in the collection
25
26
  def at_least?(limit, &block)
26
- ocurrences_of(&block) >= limit
27
+ occurrences_of(&block) >= limit
27
28
  end
28
29
 
29
30
  # Count how often the condition given in the block
30
31
  # is met for the collection
31
- def ocurrences_of &block
32
- inject(0) { |res, el|
32
+ def occurrences_of
33
+ inject(0) do |res, el|
33
34
  res += 1 if yield el
34
35
  res
35
- }
36
+ end
36
37
  end
37
-
38
38
  end
@@ -1,5 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'limit_detectors/version'
5
6
 
@@ -8,8 +9,8 @@ Gem::Specification.new do |spec|
8
9
  spec.version = LimitDetectors::VERSION
9
10
  spec.authors = ['Stephan Kämper']
10
11
  spec.email = ['the.tester@seasidetesting.com']
11
- spec.summary = %q{Detect certain conditions of elements of an Enumerable object}
12
- spec.description = %q{Some methods to detect whether an Enumerable object contains a constrained number of elements that match a given condition.}
12
+ spec.summary = 'Detect certain conditions of elements of an Enumerable object'
13
+ spec.description = 'Some methods to detect whether an Enumerable object contains a constrained number of elements that match a given condition.'
13
14
  spec.homepage = ''
14
15
  spec.license = 'MIT'
15
16
 
@@ -19,8 +20,11 @@ Gem::Specification.new do |spec|
19
20
  spec.require_paths = ['lib']
20
21
 
21
22
  spec.add_development_dependency 'bundler'
22
- spec.add_development_dependency 'rake', '~> 12.3'
23
- spec.add_development_dependency 'rspec', '~> 3.6'
24
- spec.add_development_dependency 'pry', '~> 0.12'
25
- spec.add_development_dependency 'pry-doc'
23
+ spec.add_development_dependency 'pry', '~> 0.14.1'
24
+ spec.add_development_dependency 'pry-doc', '~> 1.2.0'
25
+ spec.add_development_dependency 'rake', '~> 13.0.6'
26
+ spec.add_development_dependency 'rspec', '~> 3.10'
27
+ spec.metadata = {
28
+ 'rubygems_mfa_required' => 'true'
29
+ }
26
30
  end
@@ -1,141 +1,137 @@
1
- require 'spec_helper'
1
+ # frozen_string_literal: true
2
+
2
3
  require 'set'
3
4
 
4
- Array.send :include, LimitDetectors
5
+ Array.include LimitDetectors
5
6
 
6
7
  describe '#at_most' do
7
-
8
8
  it 'is true for an empty Array' do
9
9
  expect(Kernel).to_not receive(:warn)
10
- expect([].at_most?(5){ true }).to be_truthy
11
- expect([].at_most?(0){ true }).to be_truthy
12
- expect([].at_most?(1){ true }).to be_truthy
13
- expect([].at_most?(5){ :foo }).to be_truthy
10
+ expect([].at_most?(5) { true }).to be_truthy
11
+ expect([].at_most?(0) { true }).to be_truthy
12
+ expect([].at_most?(1) { true }).to be_truthy
13
+ expect([].at_most?(5) { :foo }).to be_truthy
14
14
  end
15
15
 
16
16
  it 'is true if the criterion is met once' do
17
- expect(["it's there"].at_most?(1){ |el| el == "it's there"}).to be_truthy
17
+ expect(["it's there"].at_most?(1) { |el| el == "it's there" }).to be_truthy
18
18
  end
19
19
 
20
20
  it 'is true if all elements meet the criterion and the size is the given maximum number' do
21
- expect([1,1,1].at_most?(3){|e| e == 1})
21
+ expect([1, 1, 1].at_most?(3) { |e| e == 1 })
22
22
  end
23
23
 
24
24
  it 'is false if not enough elements meet the criterion' do
25
- expect([1, 2, 4].at_most?(1){|e| e.even?}).to be_falsey
25
+ expect([1, 2, 4].at_most?(1, &:even?)).to be_falsey
26
26
  end
27
27
 
28
28
  it 'is true if 0 elements are expected to match' do
29
- r = Array.new(10){rand}
30
- expect(r.at_most?(0){ |i| i > 2 }).to be_truthy
29
+ r = Array.new(10) { rand }
30
+ expect(r.at_most?(0) { |i| i > 2 }).to be_truthy
31
31
  end
32
32
 
33
33
  describe 'Hash#at_most' do
34
- Hash.send :include, LimitDetectors
34
+ Hash.include LimitDetectors
35
35
  it 'detects a condition based on key as well as value properties' do
36
- h = { 'foo' => 1, 'bar' => 4, 'baz' => 5, 'bum' => 1, 'fum' => 0}
37
- expect( h.at_most?(3){|ky,vl| ky.match(/^b/) || vl > 1 }).to be_truthy
36
+ h = { 'foo' => 1, 'bar' => 4, 'baz' => 5, 'bum' => 1, 'fum' => 0 }
37
+ expect(h.at_most?(3) { |ky, vl| ky.match(/^b/) || vl > 1 }).to be_truthy
38
38
  end
39
39
  end
40
-
41
40
  end
42
41
 
43
42
  describe '#at_least' do
44
-
45
43
  it 'is false for an empty Array, if at least one is expected' do
46
44
  expect(Kernel).to_not receive(:warn)
47
- expect([].at_least?(1){ true }).to be_falsey
45
+ expect([].at_least?(1) { true }).to be_falsey
48
46
  end
49
47
 
50
48
  it 'is true if the expected number is 0 and Array is empty' do
51
- expect([].at_least?(0){ true }).to be_truthy
52
- expect({}.at_least?(0){ false }).to be_truthy
49
+ expect([].at_least?(0) { true }).to be_truthy
50
+ expect({}.at_least?(0) { false }).to be_truthy
53
51
  end
54
52
 
55
53
  it 'is false if the container ist smaller than the expected number' do
56
54
  size = 10
57
- expect(Array.new(10).at_least?(size + 1){true}).to be_falsey
55
+ expect(Array.new(10).at_least?(size + 1) { true }).to be_falsey
58
56
  end
59
57
 
60
58
  it 'is true if the criterion is met and expected once' do
61
- expect(["it's there"].at_least?(1){ |el| el == "it's there"}).to be_truthy
59
+ expect(["it's there"].at_least?(1) { |el| el == "it's there" }).to be_truthy
62
60
  end
63
61
 
64
- it 'is false for an empty Array if you expect at leat 1' do
65
- expect([].at_least?(1){ true }).to be_falsey
62
+ it 'is false for an empty Array if you expect at least 1' do
63
+ expect([].at_least?(1) { true }).to be_falsey
66
64
  end
67
65
 
68
- it 'is true for an empty Array if you expect at leat 0' do
69
- expect([].at_least?(0){ }).to be_truthy
66
+ it 'is true for an empty Array if you expect at least 0' do
67
+ expect([].at_least?(0) {}).to be_truthy
70
68
  end
71
69
 
72
70
  it 'is true if the criterion is met once' do
73
- expect(["it's there"].at_least?(1){ |el| el == "it's there"}).to be_truthy
71
+ expect(["it's there"].at_least?(1) { |el| el == "it's there" }).to be_truthy
74
72
  end
75
73
 
76
74
  it 'is true if all elements meet the criterion and the size is the given minimum number' do
77
- expect([1,1,1].at_least?(3){|e| e == 1}).to be_truthy
75
+ expect([1, 1, 1].at_least?(3) { |e| e == 1 }).to be_truthy
78
76
  end
79
77
 
80
78
  it 'is true if enough elements meet the criterion' do
81
- expect([1, 2, 4, 8].at_least?(2){|e| e.even?}).to be_truthy
79
+ expect([1, 2, 4, 8].at_least?(2, &:even?)).to be_truthy
82
80
  end
83
81
 
84
82
  it 'is true if there are enough elements to match' do
85
- r = Array.new(10){|i|i}
86
- expect(r.at_least?(7){ |i| i > 2 }).to be_truthy
87
- expect(r.at_least?(8){ |i| i > 2 }).to be_falsey
83
+ r = Array.new(10) { |i| i }
84
+ expect(r.at_least?(7) { |i| i > 2 }).to be_truthy
85
+ expect(r.at_least?(8) { |i| i > 2 }).to be_falsey
88
86
  end
89
-
90
87
  end
91
88
 
92
89
  describe '#ocurrences_of' do
93
90
  context 'collection with content' do
94
- Set.send :include, LimitDetectors
95
- subject{ Set.new( [1, 2, 3, 4, 5, 6, 7]) }
91
+ Set.include LimitDetectors
92
+ subject { Set.new([1, 2, 3, 4, 5, 6, 7]) }
96
93
 
97
- it('counts 3 even numbers') { expect( subject.ocurrences_of &:even?).to be 3 }
98
- it('counts 4 odd numbers') { expect( subject.ocurrences_of &:odd?).to be 4 }
99
- it('counts no number < 0') { expect( subject.ocurrences_of{ |e| e < 0}).to be 0 }
100
- it('counts 7 positive numbers') { expect( subject.ocurrences_of{ |e| e > 0}).to be 7 }
94
+ it('counts 3 even numbers') { expect(subject.occurrences_of(&:even?)).to be 3 }
95
+ it('counts 4 odd numbers') { expect(subject.occurrences_of(&:odd?)).to be 4 }
96
+ it('counts no number < 0') { expect(subject.occurrences_of { |e| e < 0 }).to be 0 }
97
+ it('counts 7 positive numbers') { expect(subject.occurrences_of { |e| e > 0 }).to be 7 }
101
98
  end
102
99
 
103
100
  context 'empty collection' do
104
101
  it 'counts 0 for any empty collection' do
105
- [[], Set.new, {}].each do | obj |
106
- expect(obj.ocurrences_of {true}).to be(0), "Expected to count 0, for an empty #{obj.class}"
102
+ [[], Set.new, {}].each do |obj|
103
+ expect(obj.occurrences_of { true }).to be(0), "Expected to count 0, for an empty #{obj.class}"
107
104
  end
108
105
  end
109
106
  end
110
107
 
111
- it('doen\'t return nil') { expect([1].ocurrences_of {}).not_to be_nil }
108
+ it("doesn't return nil") { expect([1].occurrences_of {}).not_to be_nil }
112
109
  end
113
110
 
114
-
115
- describe 'Using an object that doesn\'t respond to #inject' do
111
+ describe "Using an object that doesn't respond to #inject" do
116
112
  object = Object.new
117
113
  object.extend LimitDetectors
118
114
  it 'will raise an exception, if it\'s sent #at_most' do
119
- expect{ object.at_most?(1){ |el| el.condition? } }.to raise_exception(NoMethodError, /undefined method .inject./)
115
+ expect { object.at_most?(1, &:condition?) }.to raise_exception(NoMethodError, /undefined method .inject./)
120
116
  end
121
117
  end
122
118
 
123
119
  describe 'Give a warning, if non-predicate versions are used' do
124
120
  it 'yields a warning for old-style at_most' do
125
121
  expect(Kernel).to receive(:warn).with(/'at_most'.+deprecated.+'at_most\?'/)
126
- [1,2,4,8].at_most(2) {|e| e.even?}
122
+ [1, 2, 4, 8].at_most(2, &:even?)
127
123
  end
128
124
 
129
125
  it 'yields a warning for old-style at_least' do
130
126
  expect(Kernel).to receive(:warn).with(/'at_least'.+deprecated.+'at_least\?'/)
131
- [1,2,4,8].at_least(2) {|e| e.even?}
132
- end
127
+ [1, 2, 4, 8].at_least(2, &:even?)
133
128
  end
129
+ end
134
130
 
135
131
  describe 'When the provided block raises an exception' do
136
- subject{ [1] }
132
+ subject { [1] }
137
133
  it 'passes up the stack unchanged' do
138
- expect{ subject.at_most?(1) { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
139
- expect{ subject.ocurrences_of { raise ArgumentError, 'BoomError'} }.to raise_error(ArgumentError, 'BoomError')
134
+ expect { subject.at_most?(1) { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
135
+ expect { subject.occurrences_of { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
140
136
  end
141
137
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'limit_detectors'
2
4
 
3
5
  # This file was generated by the `rspec --init` command. Conventionally, all
@@ -7,9 +9,9 @@ require 'limit_detectors'
7
9
  #
8
10
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
9
11
  RSpec.configure do |config|
10
- #config.treat_symbols_as_metadata_keys_with_true_values = true
11
- #config.run_all_when_everything_filtered = true
12
- #config.filter_run :focus
12
+ # config.treat_symbols_as_metadata_keys_with_true_values = true
13
+ # config.run_all_when_everything_filtered = true
14
+ # config.filter_run :focus
13
15
 
14
16
  # Run specs in random order to surface order dependencies. If you find an
15
17
  # order dependency and want to debug it, you can fix the order by providing
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limit_detectors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephan Kämper
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-25 00:00:00.000000000 Z
11
+ date: 2021-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,61 +25,61 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '12.3'
33
+ version: 0.14.1
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '12.3'
40
+ version: 0.14.1
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: pry-doc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.6'
47
+ version: 1.2.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.6'
54
+ version: 1.2.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.12'
61
+ version: 13.0.6
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.12'
68
+ version: 13.0.6
69
69
  - !ruby/object:Gem::Dependency
70
- name: pry-doc
70
+ name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '3.10'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '3.10'
83
83
  description: Some methods to detect whether an Enumerable object contains a constrained
84
84
  number of elements that match a given condition.
85
85
  email:
@@ -88,13 +88,15 @@ executables: []
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
+ - ".github/workflows/ruby.yml"
91
92
  - ".gitignore"
92
93
  - ".rspec"
93
- - ".travis.yml"
94
+ - ".rubocop.yml"
94
95
  - Gemfile
95
96
  - LICENSE.txt
96
97
  - README.md
97
98
  - Rakefile
99
+ - example/example.rb
98
100
  - lib/limit_detectors.rb
99
101
  - lib/limit_detectors/version.rb
100
102
  - limit_detectors.gemspec
@@ -103,8 +105,9 @@ files:
103
105
  homepage: ''
104
106
  licenses:
105
107
  - MIT
106
- metadata: {}
107
- post_install_message:
108
+ metadata:
109
+ rubygems_mfa_required: 'true'
110
+ post_install_message:
108
111
  rdoc_options: []
109
112
  require_paths:
110
113
  - lib
@@ -119,8 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
122
  - !ruby/object:Gem::Version
120
123
  version: '0'
121
124
  requirements: []
122
- rubygems_version: 3.0.1
123
- signing_key:
125
+ rubygems_version: 3.3.4
126
+ signing_key:
124
127
  specification_version: 4
125
128
  summary: Detect certain conditions of elements of an Enumerable object
126
129
  test_files:
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- sudo: false
4
-
5
- rvm:
6
- - 2.2.7
7
- - 2.3.4
8
- - 2.5.2
9
- - 2.6.0
10
- - jruby