regexp-match-polyfill 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: eb3a1f8807ca2c7c61a18d1092c5d6e2ba79aae4
4
- data.tar.gz: 77243be2b75232def788d8b19559f96edbc7ade8
3
+ metadata.gz: e7da60e6e01fc354c5d5c74ad72a2f28d6220d76
4
+ data.tar.gz: e77e5fd3f610b1ca705c92048c29c3982dcde6b2
5
5
  SHA512:
6
- metadata.gz: e506741f1fe9f128c79510815e6c77d7d6e11a63465a8144a813eb693d20f8a4f1c07f608208bc93c9025334b95c9bf357fb63c64c48b73389f0e6a469075531
7
- data.tar.gz: fed920f6ae019cf3d45d668bfa3dc6511879ff7a73c987774ab14b75833723bac3bbd65b20036c74ab9d2bd2b7af3e0c46e9347930b6c74d56b490a51f5322de
6
+ metadata.gz: b9f20128834c0bb1da924515122a453bf638c822e302068dccb05948a525784ecdd85a6a350bd6d29ae5892bed968a5a73604cfa100c52928ea10a6fc87bc187
7
+ data.tar.gz: e140fda9bfd546c794d819cf29694db823725e8388cbf45e559516ab4e2ce1e42b8f5d9342c056b5b97503d31a8c5ff1601b31508944827d4379cebfed7ce7f8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- regexp-match-polyfill (1.0.0)
4
+ regexp-match-polyfill (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## Implements Regexp#match? and String#match? in Ruby < 2.4.
1
+ ## Implements Regexp#match?, String#match? and Symbol#match? in Ruby < 2.4.
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/regexp-match-polyfill.svg)](https://badge.fury.io/rb/regexp-match-polyfill)
4
4
  [![Build Status](https://travis-ci.org/yivo/regexp-match-polyfill.svg?branch=master)](https://travis-ci.org/yivo/regexp-match-polyfill)
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module RegexpMatchPolyfill
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
@@ -1,7 +1,10 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
- unless Regexp.instance_methods.include?(:match?) && String.instance_methods.include?(:match?)
4
+ unless Regexp.instance_methods.include?(:match?) &&
5
+ String.instance_methods.include?(:match?) &&
6
+ Symbol.instance_methods.include?(:match?)
7
+
5
8
  module RegexpMatchPolyfill
6
9
  module RegexpExtension
7
10
  def match?(string, position = 0)
@@ -18,4 +21,5 @@ unless Regexp.instance_methods.include?(:match?) && String.instance_methods.incl
18
21
 
19
22
  Regexp.include RegexpMatchPolyfill::RegexpExtension
20
23
  String.include RegexpMatchPolyfill::StringExtension
24
+ Symbol.include RegexpMatchPolyfill::StringExtension
21
25
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
8
8
  s.version = RegexpMatchPolyfill::VERSION
9
9
  s.author = 'Yaroslav Konoplov'
10
10
  s.email = 'eahome00@gmail.com'
11
- s.summary = 'Implements Regexp#match? and String#match? in Ruby < 2.4.'
12
- s.description = 'Implements Regexp#match? and String#match? in Ruby < 2.4.'
11
+ s.summary = 'Implements Regexp#match?, String#match? and Symbol#match? in Ruby < 2.4.'
12
+ s.description = 'Implements Regexp#match?, String#match? and Symbol#match? in Ruby < 2.4.'
13
13
  s.homepage = 'https://github.com/yivo/regexp-match-polyfill'
14
14
  s.license = 'MIT'
15
15
 
@@ -14,4 +14,9 @@ class RegexpMatchPolyfillTest < Test::Unit::TestCase
14
14
  assert_true 'foo'.match?(/foo/)
15
15
  assert_false 'foo'.match?(/bar/)
16
16
  end
17
+
18
+ def test_symbol_match
19
+ assert_true :foo.match?(/foo/)
20
+ assert_false :foo.match?(/bar/)
21
+ end
17
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regexp-match-polyfill
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Konoplov
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.2'
55
- description: Implements Regexp#match? and String#match? in Ruby < 2.4.
55
+ description: Implements Regexp#match?, String#match? and Symbol#match? in Ruby < 2.4.
56
56
  email: eahome00@gmail.com
57
57
  executables: []
58
58
  extensions: []
@@ -88,9 +88,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.6.8
91
+ rubygems_version: 2.5.2
92
92
  signing_key:
93
93
  specification_version: 4
94
- summary: Implements Regexp#match? and String#match? in Ruby < 2.4.
94
+ summary: Implements Regexp#match?, String#match? and Symbol#match? in Ruby < 2.4.
95
95
  test_files:
96
96
  - test/test-regexp-match-polyfill.rb