regexp-examples 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/core_extensions/regexp/examples.rb +2 -2
- data/lib/regexp-examples/config.rb +3 -3
- data/lib/regexp-examples/version.rb +1 -1
- data/regexp-examples.gemspec +1 -0
- data/spec/gem_helper.rb +2 -1
- data/spec/spec_helper.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38fbbe3d506284921194e15fded3d672d114212223e46cc380bba3f0f669b432
|
4
|
+
data.tar.gz: d0c47861293efcf61aa4f0d7ce3eee05aac8e57c43affe9a0e58af61e8cbc50b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 989d3c74e5120a0612d340b3919e511b8aad3eabc06a5c939bab2deb724f0168644af75f4e47c5b5c577689df768c8414ac1c93a1e1d4cf0885f75a8a983d1ca
|
7
|
+
data.tar.gz: 8125cb96126af56ce2fc283e47da4963706e86f11f9fa287c8fdd4b495514852c6ab64aad061ce60a19160694eea39382621cfda56ad92808d2f4fc855f0448d
|
data/.travis.yml
CHANGED
@@ -5,13 +5,13 @@ module CoreExtensions
|
|
5
5
|
# No core classes are extended in any way, other than the above two methods.
|
6
6
|
module Examples
|
7
7
|
def examples(**config_options)
|
8
|
-
RegexpExamples::Config.with_configuration(config_options) do
|
8
|
+
RegexpExamples::Config.with_configuration(**config_options) do
|
9
9
|
examples_by_method(:result)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
def random_example(**config_options)
|
14
|
-
RegexpExamples::Config.with_configuration(config_options) do
|
14
|
+
RegexpExamples::Config.with_configuration(**config_options) do
|
15
15
|
examples_by_method(:random_result).sample
|
16
16
|
end
|
17
17
|
end
|
@@ -27,10 +27,10 @@ module RegexpExamples
|
|
27
27
|
original_config = config.dup
|
28
28
|
|
29
29
|
begin
|
30
|
-
|
30
|
+
update_config(**new_config)
|
31
31
|
result = yield
|
32
32
|
ensure
|
33
|
-
|
33
|
+
update_config(**original_config)
|
34
34
|
end
|
35
35
|
|
36
36
|
result
|
@@ -48,7 +48,7 @@ module RegexpExamples
|
|
48
48
|
|
49
49
|
private
|
50
50
|
|
51
|
-
def
|
51
|
+
def update_config(**args)
|
52
52
|
Thread.current[:regexp_examples_config].merge!(args)
|
53
53
|
end
|
54
54
|
|
data/regexp-examples.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_development_dependency 'bundler', '> 1.7'
|
18
18
|
s.add_development_dependency 'rake', '~> 12.0'
|
19
19
|
s.add_development_dependency 'pry', '~> 0.12.0'
|
20
|
+
s.add_development_dependency 'warning', '~> 0.10.0'
|
20
21
|
s.license = 'MIT'
|
21
22
|
s.required_ruby_version = '>= 2.4.0'
|
22
23
|
end
|
data/spec/gem_helper.rb
CHANGED
@@ -6,13 +6,14 @@ Coveralls.wear!
|
|
6
6
|
require './lib/regexp-examples.rb'
|
7
7
|
require 'helpers'
|
8
8
|
require 'pry'
|
9
|
+
require 'warning'
|
9
10
|
|
10
11
|
# Several of these tests (intentionally) use "weird" regex patterns,
|
11
12
|
# that spam annoying warnings when running.
|
12
13
|
# E.g. warning: invalid back reference: /\k/
|
13
14
|
# and warning: character class has ']' without escape: /[]]/
|
14
15
|
# This config disables those warnings.
|
15
|
-
|
16
|
+
Warning.ignore(//, __dir__)
|
16
17
|
|
17
18
|
RSpec.configure do |config|
|
18
19
|
config.include Helpers
|
data/spec/spec_helper.rb
CHANGED
@@ -65,7 +65,7 @@ RSpec.configure do |config|
|
|
65
65
|
|
66
66
|
# This setting enables warnings. It's recommended, but in some cases may
|
67
67
|
# be too noisy due to issues in dependencies.
|
68
|
-
config.warnings =
|
68
|
+
config.warnings = false
|
69
69
|
|
70
70
|
# Many RSpec users commonly either run the entire suite or an individual
|
71
71
|
# file, and it's useful to allow more verbose output when running an
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regexp-examples
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Lord
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.12.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: warning
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.10.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.10.0
|
55
69
|
description: Regexp#examples returns a list of "all" strings that are matched by the
|
56
70
|
regex. Regexp#random_example returns one, random string that matches.
|
57
71
|
email: lord.thom@gmail.com
|