rantly 2.0.0 → 3.0.0

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: 13f1bd6f943416c68aff13d50f505ff92485c1613c4c01b52d8cbc78eb027b66
4
- data.tar.gz: af1de15faf3be9d3984c1343eb59b65081d0d8c12916c07434e0353ee37a4204
3
+ metadata.gz: 406db7ec111ce8f3580b6f76970b4baf110bae5926a5cc476f55ee435d857b4a
4
+ data.tar.gz: 5e42ee8b71cd692f7cd330fce8e3b65807ee9405afeb5ef2a847111da8ebefea
5
5
  SHA512:
6
- metadata.gz: 2f24ffc2cb269a377fb0b5c0e40897ba417ef991d5e219c0a0423458b8b5e760102ba1f32c157190f982419da8f8e6a32e628e1012a0d070d36045609e0a7255
7
- data.tar.gz: bb6c3265fbfcd2a0d339dbdf87d6f38afb9e71c5f4f58531c92ce99d784ad5e66405f0a26b6caf6aed9a7cc86bebe6b4194273c389073041b7890abb79f51c03
6
+ metadata.gz: d83625897b4e83a7fed19c07922d2f456e14e69f86d56fdc0d13e7e0651ac71f28d897f2208815c383e602c7ab2093c3e28b33fd9b9eb957869764d117009c7a
7
+ data.tar.gz: d2362962331c07a90c37622ef9cef880de4cbb982daa04cc4cf5c38b178202616b6637527d03249e6941beeab588a57329fc982a09237041bdb231bbca467c9a
data/Gemfile CHANGED
@@ -3,8 +3,9 @@ source 'https://rubygems.org'
3
3
  group :development, :test do
4
4
  gem 'coveralls', '>= 0', require: false
5
5
  gem 'minitest', '~> 5.10.0'
6
- gem 'rake', '~> 12.0.0'
6
+ gem 'rake', '~> 12.3.3'
7
7
  gem 'simplecov', '>= 0'
8
8
 
9
9
  gem 'rubocop'
10
+ gem 'rubocop-performance', require: false
10
11
  end
data/README.md CHANGED
@@ -15,7 +15,7 @@ Its implementation has no alien mathematics inside. Completely side-effect-free-
15
15
 
16
16
  # Install
17
17
 
18
- Rantly requires Ruby 2.4 or higher. To install Rantly add it to your Gemfile or run:
18
+ Rantly requires Ruby 3.2 or higher. To install Rantly add it to your Gemfile or run:
19
19
 
20
20
  ```ruby
21
21
  $ gem install rantly
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
- ---
2
- :build:
3
- :major: 2
1
+ ---
2
+ :build:
3
+ :major: 3
4
4
  :minor: 0
5
5
  :patch: 0
@@ -1,6 +1,7 @@
1
1
  class Rantly
2
2
  class << self
3
3
  attr_writer :default_size
4
+
4
5
  def singleton
5
6
  @singleton ||= Rantly.new
6
7
  @singleton
@@ -1,5 +1,6 @@
1
1
  require 'minitest'
2
2
  require 'rantly/property'
3
+ require "minitest/unit" unless defined?(MiniTest)
3
4
 
4
5
  test_class = if defined?(MiniTest::Test)
5
6
  MiniTest::Test
@@ -5,12 +5,12 @@ require 'stringio'
5
5
  class Rantly::Property
6
6
  attr_reader :failed_data, :shrunk_failed_data
7
7
 
8
- VERBOSITY = ENV.fetch('RANTLY_VERBOSE') { 1 }.to_i
9
- RANTLY_COUNT = ENV.fetch('RANTLY_COUNT') { 100 }.to_i
8
+ VERBOSITY = ENV.fetch('RANTLY_VERBOSE', 1).to_i
9
+ RANTLY_COUNT = ENV.fetch('RANTLY_COUNT', 100).to_i
10
10
 
11
11
  def io
12
12
  @io ||= if VERBOSITY >= 1
13
- STDOUT
13
+ $stdout
14
14
  else
15
15
  StringIO.new
16
16
  end
@@ -41,7 +41,7 @@ class Rantly::Property
41
41
  io.puts
42
42
  io.puts "FAILURE - #{i} successful tests, too many tries: #{e.tries}"
43
43
  raise e.exception("#{i} successful tests, too many tries: #{e.tries} (limit: #{e.limit})")
44
- rescue Exception => boom
44
+ rescue Exception => e
45
45
  io.puts
46
46
  io.puts "FAILURE - #{i} successful tests, failed on:"
47
47
  pretty_print test_data
@@ -51,7 +51,7 @@ class Rantly::Property
51
51
  io.puts "Minimal failed data (depth #{@depth}) is:"
52
52
  pretty_print @shrunk_failed_data
53
53
  end
54
- raise boom.exception("#{i} successful tests, failed on:\n#{test_data}\n\n#{boom}\n")
54
+ raise e.exception("#{i} successful tests, failed on:\n#{test_data}\n\n#{e}\n")
55
55
  end
56
56
  end
57
57
 
@@ -1,4 +1,4 @@
1
- require 'rspec'
1
+ require 'rspec/core'
2
2
  require 'rantly/property'
3
3
 
4
4
  class RSpec::Core::ExampleGroup
@@ -1,18 +1,17 @@
1
1
  # Integer : shrink to zero
2
2
  class Integer
3
3
  def shrink
4
- shrunk = if self > 8
5
- self / 2
6
- elsif self > 0
7
- self - 1
8
- elsif self < -8
9
- (self + 1) / 2
10
- elsif self < 0
11
- self + 1
12
- else
13
- 0
4
+ if self > 8
5
+ self / 2
6
+ elsif self > 0
7
+ self - 1
8
+ elsif self < -8
9
+ (self + 1) / 2
10
+ elsif self < 0
11
+ self + 1
12
+ else
13
+ 0
14
14
  end
15
- shrunk
16
15
  end
17
16
 
18
17
  def retry?
data/rantly.gemspec CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.name = 'rantly'
3
3
  s.summary = 'Ruby Imperative Random Data Generator and Quickcheck'
4
4
  s.homepage = 'https://github.com/rantly-rb/rantly'
5
- s.version = '2.0.0'
5
+ s.version = '3.0.0'
6
6
  s.license = 'MIT'
7
7
  s.require_paths = ['lib']
8
8
  s.authors = ['Ana María Martínez Gómez', 'Howard Yeh', 'Anthony Bargnesi', 'Eric Bischoff']
@@ -38,5 +38,5 @@ Gem::Specification.new do |s|
38
38
  'test/shrinks_test.rb',
39
39
  'test/test_helper.rb'
40
40
  ]
41
- s.required_ruby_version = '>= 2.4.0'
41
+ s.required_ruby_version = '>= 3.3.0'
42
42
  end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rantly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ana María Martínez Gómez
8
8
  - Howard Yeh
9
9
  - Anthony Bargnesi
10
10
  - Eric Bischoff
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-01-08 00:00:00.000000000 Z
14
+ date: 2024-10-21 00:00:00.000000000 Z
15
15
  dependencies: []
16
- description:
16
+ description:
17
17
  email:
18
18
  - anamma06@gmail.com
19
19
  - hayeah@gmail.com
@@ -54,7 +54,7 @@ homepage: https://github.com/rantly-rb/rantly
54
54
  licenses:
55
55
  - MIT
56
56
  metadata: {}
57
- post_install_message:
57
+ post_install_message:
58
58
  rdoc_options: []
59
59
  require_paths:
60
60
  - lib
@@ -62,15 +62,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
62
62
  requirements:
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 2.4.0
65
+ version: 3.3.0
66
66
  required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubygems_version: 3.0.0
73
- signing_key:
72
+ rubygems_version: 3.5.9
73
+ signing_key:
74
74
  specification_version: 4
75
75
  summary: Ruby Imperative Random Data Generator and Quickcheck
76
76
  test_files: []