law_string 1.2.1 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +34 -0
- data/Gemfile.lock +23 -23
- data/README.md +2 -3
- data/law_string.gemspec +3 -3
- data/lib/law_string.rb +34 -2
- metadata +12 -12
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce2fa623d1bc3ad730ffc6be0d773db7217ed0a062eefec97a4ba1473b6fc7e3
|
4
|
+
data.tar.gz: 0232445e2d84685ec0b738af425220b9bb259f2c3c83ae12f4801d5f9fb327e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e19883a936c6192ab1302a56e593883232a49806bf8486c906684852f9f6a8ad4018f3146652c700b2214bfd51c9904efb9d28cf4b5e4c524dc3ba7a7d51818
|
7
|
+
data.tar.gz: 40bd2cb853167794e47fdd6012dfd18607b9a278b5bfc9a9fd7559d55af8e08cc38d89b8f4d31cc94dbb4c0ccaff24e6748311e80b020ce8a6a311b607194641
|
@@ -0,0 +1,34 @@
|
|
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
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby-version: ['2.7', '3.0', '3.1']
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- name: Set up Ruby
|
27
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
28
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
29
|
+
uses: ruby/setup-ruby@v1
|
30
|
+
with:
|
31
|
+
ruby-version: ${{ matrix.ruby-version }}
|
32
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
33
|
+
- name: Run tests
|
34
|
+
run: bundle exec rake
|
data/Gemfile.lock
CHANGED
@@ -1,42 +1,42 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
law_string (1.2.
|
4
|
+
law_string (1.2.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
diff-lcs (1.
|
10
|
-
docile (1.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
rspec-
|
15
|
-
rspec-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
rspec-expectations (3.8.1)
|
9
|
+
diff-lcs (1.5.0)
|
10
|
+
docile (1.4.0)
|
11
|
+
rake (13.0.6)
|
12
|
+
rspec (3.12.0)
|
13
|
+
rspec-core (~> 3.12.0)
|
14
|
+
rspec-expectations (~> 3.12.0)
|
15
|
+
rspec-mocks (~> 3.12.0)
|
16
|
+
rspec-core (3.12.2)
|
17
|
+
rspec-support (~> 3.12.0)
|
18
|
+
rspec-expectations (3.12.3)
|
20
19
|
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
-
rspec-support (~> 3.
|
22
|
-
rspec-mocks (3.
|
20
|
+
rspec-support (~> 3.12.0)
|
21
|
+
rspec-mocks (3.12.5)
|
23
22
|
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
-
rspec-support (~> 3.
|
25
|
-
rspec-support (3.
|
26
|
-
simplecov (0.
|
23
|
+
rspec-support (~> 3.12.0)
|
24
|
+
rspec-support (3.12.1)
|
25
|
+
simplecov (0.22.0)
|
27
26
|
docile (~> 1.1)
|
28
|
-
|
29
|
-
|
30
|
-
simplecov-html (0.
|
27
|
+
simplecov-html (~> 0.11)
|
28
|
+
simplecov_json_formatter (~> 0.1)
|
29
|
+
simplecov-html (0.12.3)
|
30
|
+
simplecov_json_formatter (0.1.4)
|
31
31
|
|
32
32
|
PLATFORMS
|
33
33
|
ruby
|
34
34
|
|
35
35
|
DEPENDENCIES
|
36
36
|
law_string!
|
37
|
-
rake
|
38
|
-
rspec
|
37
|
+
rake
|
38
|
+
rspec
|
39
39
|
simplecov
|
40
40
|
|
41
41
|
BUNDLED WITH
|
42
|
-
2.
|
42
|
+
2.4.15
|
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
[![Build Status](https://travis-ci.org/public-law/law_string.svg?branch=master)](https://travis-ci.org/public-law/law_string)
|
1
|
+
LawString
|
2
|
+
=========
|
4
3
|
|
5
4
|
A few string util functions which support the [Public.Law](https://www.public.law) apps. Optimized for reduced object instantiation
|
6
5
|
at the expense of readability.
|
data/law_string.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'law_string'
|
8
|
-
spec.version = '1.2.
|
8
|
+
spec.version = '1.2.3'
|
9
9
|
spec.authors = ['Robb Shecter']
|
10
10
|
spec.email = ['robb@public.law']
|
11
11
|
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_development_dependency 'rake'
|
25
|
-
spec.add_development_dependency 'rspec'
|
24
|
+
spec.add_development_dependency 'rake'
|
25
|
+
spec.add_development_dependency 'rspec'
|
26
26
|
spec.add_development_dependency 'simplecov'
|
27
27
|
end
|
data/lib/law_string.rb
CHANGED
@@ -6,8 +6,40 @@ require 'set'
|
|
6
6
|
# Specialized #titleize and #add_typography methods.
|
7
7
|
class String
|
8
8
|
# For AP Style Titles
|
9
|
-
|
10
|
-
|
9
|
+
# A decent article: https://prowritingaid.com/list-of-words-not-capitalized-in-titles
|
10
|
+
NOT_CAPITALIZED = Set.new %w[
|
11
|
+
a
|
12
|
+
an
|
13
|
+
and
|
14
|
+
as
|
15
|
+
at
|
16
|
+
but
|
17
|
+
by
|
18
|
+
down
|
19
|
+
for
|
20
|
+
from
|
21
|
+
if
|
22
|
+
in
|
23
|
+
into
|
24
|
+
near
|
25
|
+
nor
|
26
|
+
of
|
27
|
+
on
|
28
|
+
onto
|
29
|
+
or
|
30
|
+
over
|
31
|
+
out
|
32
|
+
so
|
33
|
+
than
|
34
|
+
that
|
35
|
+
the
|
36
|
+
to
|
37
|
+
up
|
38
|
+
with
|
39
|
+
yet
|
40
|
+
].freeze
|
41
|
+
|
42
|
+
INITIALISMS = Set.new %w[atm usa].freeze
|
11
43
|
|
12
44
|
INITIALS_REGEX = /^([a-zA-Z]\.)+$/.freeze
|
13
45
|
WHITESPACES_REGEX = /[[:space:]]/.freeze
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: law_string
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robb Shecter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: simplecov
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,9 +60,9 @@ executables: []
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
+
- ".github/workflows/ruby.yml"
|
63
64
|
- ".gitignore"
|
64
65
|
- ".rspec"
|
65
|
-
- ".travis.yml"
|
66
66
|
- Gemfile
|
67
67
|
- Gemfile.lock
|
68
68
|
- LICENSE.txt
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
94
|
+
rubygems_version: 3.4.15
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: 'String Utils including a specialized #titleize.'
|