attribute_normalizer-extras 0.1.0 → 0.2.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 +5 -5
- data/.github/workflows/main.yml +14 -0
- data/README.md +2 -0
- data/attribute_normalizer-extras.gemspec +18 -2
- data/lib/attribute_normalizer/extras/version.rb +1 -1
- data/lib/attribute_normalizer/extras.rb +5 -1
- data/lib/attribute_normalizer/normalizers/downcase_normalizer.rb +9 -0
- data/lib/attribute_normalizer/normalizers/upcase_normalizer.rb +9 -0
- data/spec/models/downcase_normalizer_spec.rb +11 -0
- data/spec/models/uppercase_normalizer_spec.rb +11 -0
- metadata +15 -12
- data/.travis.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c581c89805c67cd717dd67e74f96461667513783fe9c04d6500cd4845c5c9c65
|
4
|
+
data.tar.gz: 7c2a8604bb2dc440d3feb15d090c3c37f2fa455e0aea1743b5c064f067bdc3ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3432b10ff2fc867edee4a4acf485743a684893c0942ee4fa7d600cbfd88494cc8d57deb1c277cb66922ec3905ffedf96100918c4fd06a8a754a6486f8bc1776c
|
7
|
+
data.tar.gz: ab1c3f3259115221928cd9a181b4a1e7ef1925b5bc494e424e97755fdd1b46335c751dc7f10f6827121650249beb06142e87cbaac18a1748cf913c5c15148c16
|
@@ -0,0 +1,14 @@
|
|
1
|
+
name: Ruby
|
2
|
+
on: [push,pull_request]
|
3
|
+
jobs:
|
4
|
+
build:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
steps:
|
7
|
+
- uses: actions/checkout@v2
|
8
|
+
- name: Set up Ruby
|
9
|
+
uses: ruby/setup-ruby@v1
|
10
|
+
with:
|
11
|
+
ruby-version: '2.7'
|
12
|
+
bundler-cache: true
|
13
|
+
- name: Run Tests
|
14
|
+
run: bundle exec rake
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://github.com/amaabca/attribute_normalizer-extras/actions/workflows/main.yml)
|
2
|
+
|
1
3
|
# AttributeNormalizer::Extras
|
2
4
|
|
3
5
|
Extra normalizers for the [attribute_normalizer](https://rubygems.org/gems/attribute_normalizer) gem
|
@@ -6,8 +6,24 @@ require 'attribute_normalizer/extras/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "attribute_normalizer-extras"
|
8
8
|
spec.version = AttributeNormalizer::Extras::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
|
9
|
+
spec.authors = [
|
10
|
+
"Darko Dosenovic",
|
11
|
+
"Michael van den Beuken",
|
12
|
+
"Ruben Estevez",
|
13
|
+
"Jordan Babe",
|
14
|
+
"Mathieu Gilbert",
|
15
|
+
"Zoie Carnegie",
|
16
|
+
"Jesse Doyle"
|
17
|
+
]
|
18
|
+
spec.email = [
|
19
|
+
"darko.dosenovic@ama.ab.ca",
|
20
|
+
"michael.vandenbeuken@ama.ab.ca",
|
21
|
+
"ruben.estevez@ama.ab.ca",
|
22
|
+
"jordan.babe@ama.ab.ca",
|
23
|
+
"mathieu.gilbert@ama.ab.ca",
|
24
|
+
"zoie.carnegie@ama.ab.ca",
|
25
|
+
"jesse.doyle@ama.ab.ca"
|
26
|
+
]
|
11
27
|
spec.summary = %q{attribute_normalizer gem extras}
|
12
28
|
spec.description = %q{Specific normalizers that we commonly use in our apps}
|
13
29
|
spec.homepage = ""
|
@@ -4,12 +4,16 @@ require "attribute_normalizer/normalizers/gsub_normalizer"
|
|
4
4
|
require "attribute_normalizer/normalizers/spaceless_normalizer"
|
5
5
|
require "attribute_normalizer/normalizers/postal_code_normalizer"
|
6
6
|
require "attribute_normalizer/normalizers/float_normalizer"
|
7
|
+
require "attribute_normalizer/normalizers/downcase_normalizer"
|
8
|
+
require "attribute_normalizer/normalizers/upcase_normalizer"
|
7
9
|
|
8
10
|
extras = {
|
9
11
|
gsub: AttributeNormalizer::Normalizers::GsubNormalizer,
|
10
12
|
postal_code: AttributeNormalizer::Normalizers::PostalCodeNormalizer,
|
11
13
|
spaceless: AttributeNormalizer::Normalizers::SpacelessNormalizer,
|
12
|
-
float: AttributeNormalizer::Normalizers::FloatNormalizer
|
14
|
+
float: AttributeNormalizer::Normalizers::FloatNormalizer,
|
15
|
+
downcase: AttributeNormalizer::Normalizers::DowncaseNormalizer,
|
16
|
+
upcase: AttributeNormalizer::Normalizers::UpcaseNormalizer
|
13
17
|
}
|
14
18
|
|
15
19
|
AttributeNormalizer.configuration.normalizers.merge! extras
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AttributeNormalizer::Normalizers::DowncaseNormalizer do
|
4
|
+
|
5
|
+
describe '.normalizer' do
|
6
|
+
it 'downcase a string' do
|
7
|
+
normalized_text = subject.normalize "I AM big STRING"
|
8
|
+
expect(normalized_text).to eq "i am big string"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AttributeNormalizer::Normalizers::UpcaseNormalizer do
|
4
|
+
|
5
|
+
describe '.normalizer' do
|
6
|
+
it 'upcase a string' do
|
7
|
+
normalized_text = subject.normalize "i AM big StrINg"
|
8
|
+
expect(normalized_text).to eq "I AM BIG STRING"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attribute_normalizer-extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darko Dosenovic
|
@@ -9,13 +9,12 @@ authors:
|
|
9
9
|
- Ruben Estevez
|
10
10
|
- Jordan Babe
|
11
11
|
- Mathieu Gilbert
|
12
|
-
-
|
13
|
-
- Jonathan Weyermann
|
12
|
+
- Zoie Carnegie
|
14
13
|
- Jesse Doyle
|
15
|
-
autorequire:
|
14
|
+
autorequire:
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
|
-
date:
|
17
|
+
date: 2021-12-10 00:00:00.000000000 Z
|
19
18
|
dependencies:
|
20
19
|
- !ruby/object:Gem::Dependency
|
21
20
|
name: bundler
|
@@ -122,15 +121,14 @@ email:
|
|
122
121
|
- ruben.estevez@ama.ab.ca
|
123
122
|
- jordan.babe@ama.ab.ca
|
124
123
|
- mathieu.gilbert@ama.ab.ca
|
125
|
-
-
|
126
|
-
- jonathan.weyermann@ama.ab.ca
|
124
|
+
- zoie.carnegie@ama.ab.ca
|
127
125
|
- jesse.doyle@ama.ab.ca
|
128
126
|
executables: []
|
129
127
|
extensions: []
|
130
128
|
extra_rdoc_files: []
|
131
129
|
files:
|
130
|
+
- ".github/workflows/main.yml"
|
132
131
|
- ".gitignore"
|
133
|
-
- ".travis.yml"
|
134
132
|
- Gemfile
|
135
133
|
- LICENSE.txt
|
136
134
|
- README.md
|
@@ -138,20 +136,24 @@ files:
|
|
138
136
|
- attribute_normalizer-extras.gemspec
|
139
137
|
- lib/attribute_normalizer/extras.rb
|
140
138
|
- lib/attribute_normalizer/extras/version.rb
|
139
|
+
- lib/attribute_normalizer/normalizers/downcase_normalizer.rb
|
141
140
|
- lib/attribute_normalizer/normalizers/float_normalizer.rb
|
142
141
|
- lib/attribute_normalizer/normalizers/gsub_normalizer.rb
|
143
142
|
- lib/attribute_normalizer/normalizers/postal_code_normalizer.rb
|
144
143
|
- lib/attribute_normalizer/normalizers/spaceless_normalizer.rb
|
144
|
+
- lib/attribute_normalizer/normalizers/upcase_normalizer.rb
|
145
|
+
- spec/models/downcase_normalizer_spec.rb
|
145
146
|
- spec/models/float_normalizer_spec.rb
|
146
147
|
- spec/models/gsub_normalizer_spec.rb
|
147
148
|
- spec/models/postal_code_normalizer_spec.rb
|
148
149
|
- spec/models/spaceless_normalizer_spec.rb
|
150
|
+
- spec/models/uppercase_normalizer_spec.rb
|
149
151
|
- spec/spec_helper.rb
|
150
152
|
homepage: ''
|
151
153
|
licenses:
|
152
154
|
- MIT
|
153
155
|
metadata: {}
|
154
|
-
post_install_message:
|
156
|
+
post_install_message:
|
155
157
|
rdoc_options: []
|
156
158
|
require_paths:
|
157
159
|
- lib
|
@@ -166,14 +168,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
168
|
- !ruby/object:Gem::Version
|
167
169
|
version: '0'
|
168
170
|
requirements: []
|
169
|
-
|
170
|
-
|
171
|
-
signing_key:
|
171
|
+
rubygems_version: 3.2.33
|
172
|
+
signing_key:
|
172
173
|
specification_version: 4
|
173
174
|
summary: attribute_normalizer gem extras
|
174
175
|
test_files:
|
176
|
+
- spec/models/downcase_normalizer_spec.rb
|
175
177
|
- spec/models/float_normalizer_spec.rb
|
176
178
|
- spec/models/gsub_normalizer_spec.rb
|
177
179
|
- spec/models/postal_code_normalizer_spec.rb
|
178
180
|
- spec/models/spaceless_normalizer_spec.rb
|
181
|
+
- spec/models/uppercase_normalizer_spec.rb
|
179
182
|
- spec/spec_helper.rb
|
data/.travis.yml
DELETED