fat_core 4.6.1 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b161f218bc83618131c95a438b303dd1169359eeedbb31bef0dfee3b50b313fd
4
- data.tar.gz: 30545b767e399b8187cbbef762684326715a0d59b68e01d19d898ba026bdf322
3
+ metadata.gz: 881fe55c54af6a96acb9ff0875df33063f4598d800785e5c46a3e2f4cd317cff
4
+ data.tar.gz: 43bac870c480a6770a39640a61c51f236f891c648a109d4b85d70b1188150cff
5
5
  SHA512:
6
- metadata.gz: a065cdb749407abc3df8cad6f8ba964667741aaabee37faa79af31d9c067b200af0e22f89f987f8039f155e6f94401effb9ba8e2af67742e26556b1e8e23f9cc
7
- data.tar.gz: eb7cd350bdd4fb72172a8dffcd90d3a90a44799b361e0c68ccf7c5da68dfdedde0911994c43d27040b1057741442809449a7b5eff0ff3683aafd481f42e59f17
6
+ metadata.gz: 45fc3d2e6e09e59ff14cc4acaa4d2a3794f990a55422b8d2b68186262b2971d566a1651075363600ac9defb03705ddff971bf0b1eb09bf1ab7cb030ab6250910
7
+ data.tar.gz: 95bc26f296c51bfcf25b15ab2e4c70f0e1ef28d053d36ee8f9917b6008e09ddbcd469dc2ab0e33e5da15809fb9ab8d749ba8e2250515e6515ecefea56e125a5f
@@ -226,12 +226,12 @@ module FatCore
226
226
  # @return [String] the matched portion of self, with punctuation stripped in
227
227
  # case of #fuzzy_match
228
228
  # @see #fuzzy_match #fuzzy_match for the specifics of string matching
229
- # @see #to_regexp #to_regexp for conversion of `matcher` to regular expression
229
+ # @see #as_regexp #as_regexp for conversion of `matcher` to regular expression
230
230
  def matches_with(matcher)
231
231
  if matcher.nil?
232
232
  nil
233
233
  elsif matcher =~ %r{^\s*/}
234
- re = matcher.to_regexp
234
+ re = matcher.as_regexp
235
235
  $& if to_s =~ re
236
236
  else
237
237
  to_s.fuzzy_match(matcher)
@@ -282,12 +282,12 @@ module FatCore
282
282
  # it to a Regexp with Regexp.new.
283
283
  #
284
284
  # @example
285
- # '/Hello/'.to_regexp #=> /Hello/i
286
- # '/Hello/I'.to_regexp #=> /Hello/
287
- # 'Hello'.to_regexp #=> /Hello/
285
+ # '/Hello/'.as_regexp #=> /Hello/i
286
+ # '/Hello/I'.as_regexp #=> /Hello/
287
+ # 'Hello'.as_regexp #=> /Hello/
288
288
  #
289
289
  # @return [Regexp]
290
- def to_regexp
290
+ def as_regexp
291
291
  if self =~ %r{^\s*/([^/]*)/([Iixm]*)\s*$}
292
292
  body = $1
293
293
  opts = $2
@@ -1,7 +1,7 @@
1
1
  module FatCore
2
2
  MAJOR = 4
3
- MINOR = 6
4
- PATCH = 1
3
+ MINOR = 7
4
+ PATCH = 0
5
5
 
6
6
  # FatCore version number
7
7
  VERSION = [MAJOR, MINOR, PATCH].compact.join('.')
@@ -150,20 +150,20 @@ the people, for the people, shall not perish from the earth."
150
150
  end
151
151
 
152
152
  it 'should be able to convert a string to a regular expression' do
153
- re = "/hello((\s+)(world))?/".to_regexp
153
+ re = "/hello((\s+)(world))?/".as_regexp
154
154
  expect(re.class).to eq Regexp
155
155
  expect(re.casefold?).to be true
156
156
  expect(re.multiline?).to be false
157
157
  expect(re.match?('Hello WorlD')).to be true
158
158
 
159
- re = "/hello((\s+)(world))?/Im".to_regexp
159
+ re = "/hello((\s+)(world))?/Im".as_regexp
160
160
  expect(re.class).to eq Regexp
161
161
  expect(re.casefold?).to be false
162
162
  expect(re.multiline?).to be true
163
163
  expect(re.match?('Hello WorlD')).to be false
164
164
 
165
165
  # Works without /../ but no options possible
166
- re = "hello((\s+)(world))?".to_regexp
166
+ re = "hello((\s+)(world))?".as_regexp
167
167
  expect(re.class).to eq Regexp
168
168
  expect(re.casefold?).to be false
169
169
  expect(re.multiline?).to be false
@@ -172,7 +172,7 @@ the people, for the people, shall not perish from the earth."
172
172
 
173
173
  it 'should be able to convert metacharacters into Regexp' do
174
174
  "\\$()*+.<>?[]^{|}".chars.each do |c|
175
- re = c.to_regexp
175
+ re = c.as_regexp
176
176
  expect(re.class).to eq Regexp
177
177
  end
178
178
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.1
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-01 00:00:00.000000000 Z
11
+ date: 2019-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov