fat_core 6.0.0 → 7.1.1
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 +4 -4
- data/.github/workflows/ruby.yml +54 -0
- data/.rubocop.yml +4 -2
- data/.simplecov +2 -0
- data/CHANGELOG.org +61 -0
- data/Gemfile +5 -4
- data/README.org +1023 -58
- data/Rakefile +16 -3
- data/bin/console +1 -0
- data/fat_core.gemspec +6 -5
- data/lib/fat_core/all.rb +9 -10
- data/lib/fat_core/array.rb +5 -5
- data/lib/fat_core/enumerable.rb +0 -15
- data/lib/fat_core/hash.rb +48 -11
- data/lib/fat_core/numeric.rb +48 -1
- data/lib/fat_core/range.rb +108 -55
- data/lib/fat_core/string.rb +78 -38
- data/lib/fat_core/symbol.rb +1 -1
- data/lib/fat_core/version.rb +3 -3
- data/lib/fat_core.rb +2 -0
- data/spec/lib/array_spec.rb +2 -0
- data/spec/lib/big_decimal_spec.rb +2 -0
- data/spec/lib/enumerable_spec.rb +29 -39
- data/spec/lib/hash_spec.rb +19 -2
- data/spec/lib/nil_class_spec.rb +2 -0
- data/spec/lib/numeric_spec.rb +14 -0
- data/spec/lib/range_spec.rb +10 -0
- data/spec/lib/string_spec.rb +96 -12
- data/spec/lib/symbol_spec.rb +2 -0
- data/spec/spec_helper.rb +3 -1
- metadata +13 -10
- data/lib/fat_core/kernel.rb +0 -26
- data/spec/lib/kernel_spec.rb +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e41b6857fb2c0b81125ed588ea89a53fa65d794e462336d96186692de9f369b3
|
|
4
|
+
data.tar.gz: 3ab1379a55487b58400c971dd81eb81d08aafe2500e4743e9402b646a6daddab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9da3d3dd996a3ffe907e618ee9f4ee550c3e720b8a27e8790d4f027c5e11b187417832e41bfe3d6d3c513c2315482302ed784dd61c87c98a2647483f838ea953
|
|
7
|
+
data.tar.gz: e5862ca6b225780f8152611064e2c4af9550a7351f2fc44a4aae20c991d6802fc4261c605afbb5d8b99f6c3790934330571219a60ef4c7f93bf613935d83cc71
|
|
@@ -0,0 +1,54 @@
|
|
|
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 CI (setup-ruby)
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
pull_request:
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
ruby: [3.2.2, 3.3.0, 3.4.0]
|
|
20
|
+
steps:
|
|
21
|
+
- name: Check out code
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Install build dependencies (needed if Ruby must be compiled)
|
|
25
|
+
run: |
|
|
26
|
+
sudo apt-get update
|
|
27
|
+
sudo apt-get install -y --no-install-recommends \
|
|
28
|
+
build-essential autoconf bison libssl-dev libreadline-dev \
|
|
29
|
+
zlib1g-dev libyaml-dev libffi-dev libgdbm-dev libncurses5-dev \
|
|
30
|
+
libgmp-dev pkg-config
|
|
31
|
+
|
|
32
|
+
- name: Set up Ruby
|
|
33
|
+
uses: ruby/setup-ruby@v1
|
|
34
|
+
with:
|
|
35
|
+
ruby-version: ${{ matrix.ruby }}
|
|
36
|
+
bundler-cache: true
|
|
37
|
+
|
|
38
|
+
- name: Verify Ruby
|
|
39
|
+
run: |
|
|
40
|
+
ruby -v
|
|
41
|
+
gem -v
|
|
42
|
+
shell: bash
|
|
43
|
+
|
|
44
|
+
- name: Install gems
|
|
45
|
+
run: |
|
|
46
|
+
gem install bundler --conservative
|
|
47
|
+
# optional: use vendor/bundle to keep gems within repo workspace
|
|
48
|
+
bundle config set --local path 'vendor/bundle' || true
|
|
49
|
+
bundle install --jobs 4 --retry 3
|
|
50
|
+
shell: bash
|
|
51
|
+
|
|
52
|
+
- name: Run tests
|
|
53
|
+
run: bundle exec rake
|
|
54
|
+
shell: bash
|
data/.rubocop.yml
CHANGED
data/.simplecov
CHANGED
data/CHANGELOG.org
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
* Version 7.1.1
|
|
2
|
+
** String
|
|
3
|
+
- =String#fuzzy_match= make period, comma, asterisk, and apostrophes optional
|
|
4
|
+
in matcher instead of just deleting them and in the subject string replace
|
|
5
|
+
periods and commas with spaces so they still act as word separators.
|
|
6
|
+
|
|
7
|
+
Before ='WWW.WOLFRAM.COM'.fuzzy_match('www:wolfram')= would not match because
|
|
8
|
+
the periods were just eliminated so the matcher was looking for a word
|
|
9
|
+
starting with 'wolfram' but the subject string was converted to
|
|
10
|
+
'WWWWOLFRAMCOM' so no match. Now it is converted to 'WWW WOLFRAM COM' so
|
|
11
|
+
the match succeeds.
|
|
12
|
+
|
|
13
|
+
* Version 7.0.0 from Version 6.0.0
|
|
14
|
+
** Enumerable
|
|
15
|
+
- Remove =#groups_of= as duplicative of =each_slice=
|
|
16
|
+
** Hash
|
|
17
|
+
- Rename =delete_with_value= to =delete_with_values!= to make it clear that
|
|
18
|
+
the Hash is modified in place,
|
|
19
|
+
- Add =delete_with_value= as a non-mutating variant
|
|
20
|
+
- Change arg to =keys_with_value(vals)= to allow variable arguments for
|
|
21
|
+
multiple values instead of requiring an Array,
|
|
22
|
+
- Allow =<<= operator to merge any =Enumerable= as well as a =Hash=
|
|
23
|
+
** Numeric
|
|
24
|
+
- Enhance =#tex_quote= to put special numbers such as =Math::PI=, =Math::E=,
|
|
25
|
+
and =Float::INFINITY= in TeX notation, so, e.g., Complex(Math::E,
|
|
26
|
+
Math:PI).tex_quote will render to "$\\pi+e i$", Rationals will be rendered
|
|
27
|
+
as fractions, etc.
|
|
28
|
+
** Range
|
|
29
|
+
- =Range#gaps= now better handles Ranges with countable endpoints that need
|
|
30
|
+
=:succ= and =:pred= methods,
|
|
31
|
+
- =tex_quote= applies =#tex_quote= to endpoints if they respond to a =#tex_quote=
|
|
32
|
+
method,
|
|
33
|
+
- Check argument Ranges to =#gaps=, =#spanned_by?=, and =#overlaps= for
|
|
34
|
+
compatibility with the subject Range,
|
|
35
|
+
** String
|
|
36
|
+
- =String#fuzzy_match= changes the semantics of the string matcher argument:
|
|
37
|
+
1. an internal ':' preceded and followed by non-whitespace now only applies
|
|
38
|
+
to the word following it to indicate that the word must be a word
|
|
39
|
+
boundary, so 'hel:wor' matches 'Shell worms' as well as 'Hello, world'.
|
|
40
|
+
2. an internal ':' preceded by whitespace but followed by non-whitespace is
|
|
41
|
+
also treated as requiring a word boundary for the following word but not
|
|
42
|
+
the preceding word, as in 1, so 'hel :wor'
|
|
43
|
+
3. but an internal ':' preceded by non-whitespace but followed by whitespace
|
|
44
|
+
requires a word boundary after the preceding word, so 'hel: wor'
|
|
45
|
+
4. a lone matcher now allows a match anywhere in the subject text regardless
|
|
46
|
+
of boundaries; the prior version added a word boundary restriction to the
|
|
47
|
+
bare matcher, so before 'zz' would not match "Pizza" since 'zz' did not
|
|
48
|
+
occur at the end of word, but now 'zz' will match "Pizza". Rule 3 above
|
|
49
|
+
allows putting a boundary restriction on the matcher with 'zz: ' as
|
|
50
|
+
before.
|
|
51
|
+
5. Leading and trailing ':' continue to require the text to occur at the
|
|
52
|
+
beginning or end, respectively, of the subject string, so ':hel' and
|
|
53
|
+
'ld:' match "Hello, world" but ':wor' and 'wor:' do not.
|
|
54
|
+
- =String#number= no longer considers a hex number with a decimal point to be
|
|
55
|
+
in the form of a number
|
|
56
|
+
- provide a :pred method in a refinement accesses with 'using StringPred
|
|
57
|
+
- =String#entitle= no longer tries to detect general acronyms for upper case
|
|
58
|
+
handling since it was unreliable. Thus, ="ibm corporation".enetitle=
|
|
59
|
+
becomers "Ibm Corporation" rather than "IBM corporation."
|
|
60
|
+
** Kernel
|
|
61
|
+
- removed the =Kernel.time_it= method since Benchmark already does this better.
|
data/Gemfile
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
source 'https://rubygems.org'
|
|
2
4
|
|
|
3
5
|
# Specify your gem's dependencies in fat_core.gemspec
|
|
4
6
|
gemspec
|
|
5
7
|
|
|
6
8
|
group :development do
|
|
7
|
-
|
|
8
|
-
gem 'rubocop
|
|
9
|
-
gem 'rubocop-
|
|
10
|
-
gem 'rubocop-rake', require: false
|
|
9
|
+
# rubocop and the shared config gem:
|
|
10
|
+
gem 'rubocop', require: false
|
|
11
|
+
gem 'rubocop-ddoherty', git: 'https://github.com/ddoherty03/rubocop-ddoherty.git', branch: 'master', require: false
|
|
11
12
|
gem 'bundler'
|
|
12
13
|
gem 'debug', '>= 1.0.0'
|
|
13
14
|
gem 'pry'
|