data_cleansing 1.0.2 → 1.0.3

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: ce7b23f60579cdfba99620dbe8d73e42c6963216126b3e9a3db9985eb423bd25
4
- data.tar.gz: dbf234f058f1d401fd81eb4f6863401f1daa2293ba57a072719aca008b3b621c
3
+ metadata.gz: 04a8c565168dcba73088d9e17afcda3ab49097a41fb55bcf880f2cd04e6d38bf
4
+ data.tar.gz: da24439e8431d81c19241b7ed579bd73170cfc8e61c1781bc103befa1e37d6fe
5
5
  SHA512:
6
- metadata.gz: a128353735b0e598532a1092018b0029f0390af20e6c37a10aa6c46fd472f6c4621e0e9d034e6f7b683cbba23d2741e877c9d0e11919d92b08b9c5900e50c7b3
7
- data.tar.gz: f47693cf8b140a9fb4b8b20bd4c8df026a8237b6b6747a3d83d210b834be89d73713465684e66f6533a6cc5971cf4b9bf2dd61b1a5b620fb1bcd79c2f02c2a1c
6
+ metadata.gz: 28d9b9af8b18271bcbedd3930b0c1882ee162470959992ab2140f4a733377aaffadb0efef52d66ffeb86a93b1c10cdbcc78d61382d09fd85f8135596bd845628
7
+ data.tar.gz: f49c9062ffa4620c723cdb1d114f3baf649b63cb273dc67cadb34212cdf1d42c54a1ad4be90cff38e02f565c2135d18c3d58ccd0e90c3031e65dfe3fbef0e01c
data/Rakefile CHANGED
@@ -1,21 +1,31 @@
1
- require 'rake/testtask'
2
- require_relative 'lib/data_cleansing/version'
1
+ # Setup bundler to avoid having to run bundle exec all the time.
2
+ require "rubygems"
3
+ require "bundler/setup"
4
+
5
+ require "rake/testtask"
6
+ require_relative "lib/data_cleansing/version"
3
7
 
4
8
  task :gem do
5
- system 'gem build data_cleansing.gemspec'
9
+ system "gem build data_cleansing.gemspec"
6
10
  end
7
11
 
8
12
  task publish: :gem do
9
13
  system "git tag -a v#{DataCleansing::VERSION} -m 'Tagging #{DataCleansing::VERSION}'"
10
- system 'git push --tags'
14
+ system "git push --tags"
11
15
  system "gem push data_cleansing-#{DataCleansing::VERSION}.gem"
12
16
  system "rm data_cleansing-#{DataCleansing::VERSION}.gem"
13
17
  end
14
18
 
15
19
  Rake::TestTask.new(:test) do |t|
16
- t.pattern = 'test/**/*_test.rb'
20
+ t.pattern = "test/**/*_test.rb"
17
21
  t.verbose = true
18
- t.warning = true
22
+ t.warning = false
19
23
  end
20
24
 
21
- task default: :test
25
+ # By default run tests against all appraisals
26
+ if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
27
+ require "appraisal"
28
+ task default: :appraisal
29
+ else
30
+ task default: :test
31
+ end
@@ -1,4 +1,4 @@
1
- require 'cgi'
1
+ require "cgi"
2
2
  module Cleaners
3
3
  # Strip leading and trailing whitespace
4
4
  module Strip
@@ -37,7 +37,7 @@ module Cleaners
37
37
  def self.call(string)
38
38
  return string unless string.is_a?(String)
39
39
 
40
- string.gsub!(NOT_WORDS, '') || string
40
+ string.gsub!(NOT_WORDS, "") || string
41
41
  end
42
42
  end
43
43
  DataCleansing.register_cleaner(:remove_non_word, RemoveNonWord)
@@ -49,6 +49,10 @@ module Cleaners
49
49
  def self.call(string)
50
50
  return string unless string.is_a?(String)
51
51
 
52
+ # Strip invalid characters, since they are non printable
53
+ unless string.valid_encoding?
54
+ string = string.encode(string.encoding, invalid: :replace, undef: :replace, replace: "")
55
+ end
52
56
  string.gsub!(NOT_PRINTABLE, '') || string
53
57
  end
54
58
  end
@@ -63,18 +67,18 @@ module Cleaners
63
67
 
64
68
  string.gsub!(HTML_MARKUP) do |match|
65
69
  case match.downcase
66
- when '&' then
67
- '&'
68
- when '"' then
70
+ when "&"
71
+ "&"
72
+ when """
69
73
  '"'
70
- when '>' then
71
- '>'
72
- when '<' then
73
- '<'
74
- when '&apos;' then
74
+ when "&gt;"
75
+ ">"
76
+ when "&lt;"
77
+ "<"
78
+ when "&apos;"
75
79
  "'"
76
- when '&nbsp;' then
77
- ' '
80
+ when "&nbsp;"
81
+ " "
78
82
  else
79
83
  "&#{match};"
80
84
  end
@@ -108,7 +112,7 @@ module Cleaners
108
112
  def self.call(string)
109
113
  return string unless string.is_a?(String)
110
114
 
111
- string.gsub!(WHITESPACE, ' ') || string
115
+ string.gsub!(WHITESPACE, " ") || string
112
116
  end
113
117
  end
114
118
  DataCleansing.register_cleaner(:compress_whitespace, CompressWhitespace)
@@ -121,7 +125,7 @@ module Cleaners
121
125
  def self.call(string)
122
126
  return string unless string.is_a?(String)
123
127
 
124
- string.gsub!(DIGITS, '')
128
+ string.gsub!(DIGITS, "")
125
129
  string.length > 0 ? string : nil
126
130
  end
127
131
  end
@@ -130,13 +134,13 @@ module Cleaners
130
134
  # Returns [Integer] after removing all non-digit characters, except '.'
131
135
  # Returns nil if no digits are present in the string.
132
136
  module StringToInteger
133
- NUMERIC = Regexp.compile(/[^0-9\.]/)
137
+ NUMERIC = Regexp.compile(/[^0-9.]/)
134
138
 
135
139
  def self.call(string)
136
140
  return string unless string.is_a?(String)
137
141
 
138
142
  # Remove Non-Digit Chars, except for '.'
139
- string.gsub!(NUMERIC, '')
143
+ string.gsub!(NUMERIC, "")
140
144
  string.length > 0 ? string.to_i : nil
141
145
  end
142
146
  end
@@ -145,13 +149,13 @@ module Cleaners
145
149
  # Returns [Integer] after removing all non-digit characters, except '.'
146
150
  # Returns nil if no digits are present in the string.
147
151
  module StringToFloat
148
- NUMERIC = Regexp.compile(/[^0-9\.]/)
152
+ NUMERIC = Regexp.compile(/[^0-9.]/)
149
153
 
150
154
  def self.call(string)
151
155
  return string unless string.is_a?(String)
152
156
 
153
157
  # Remove Non-Digit Chars, except for '.'
154
- string.gsub!(NUMERIC, '')
158
+ string.gsub!(NUMERIC, "")
155
159
  string.length > 0 ? string.to_f : nil
156
160
  end
157
161
  end
@@ -1,4 +1,4 @@
1
- require 'data_cleansing/cleaners'
1
+ require "data_cleansing/cleaners"
2
2
  module DataCleansing
3
3
  # Mix-in to add cleaner
4
4
  module Cleanse
@@ -9,7 +9,7 @@ module DataCleansing
9
9
  def cleanse(*args)
10
10
  last = args.last
11
11
  attributes = args.dup
12
- params = (last.is_a?(Hash) && last.instance_of?(Hash)) ? attributes.pop.dup : {}
12
+ params = last.is_a?(Hash) && last.instance_of?(Hash) ? attributes.pop.dup : {}
13
13
  cleaners = Array(params.delete(:cleaner))
14
14
  raise(ArgumentError, "Mandatory :cleaner parameter is missing: #{params.inspect}") unless cleaners
15
15
 
@@ -34,6 +34,7 @@ module DataCleansing
34
34
  def after_cleanse(*methods)
35
35
  methods.each do |m|
36
36
  raise "Method #{m.inspect} must be a symbol" unless m.is_a?(Symbol)
37
+
37
38
  data_cleansing_after_cleaners << m unless data_cleansing_after_cleaners.include?(m)
38
39
  end
39
40
  end
@@ -53,7 +54,7 @@ module DataCleansing
53
54
  #
54
55
  # Warning: If any of the cleaners read or write to other object attributes
55
56
  # then a valid object instance must be supplied
56
- def cleanse_attribute(attribute_name, value, object=nil)
57
+ def cleanse_attribute(attribute_name, value, object = nil)
57
58
  return if value.nil?
58
59
 
59
60
  # Collect parent cleaners first, starting with the top parent
@@ -100,6 +101,7 @@ module DataCleansing
100
101
  # itself is not modified
101
102
  def data_cleansing_clean(cleaner_struct, value, binding = nil)
102
103
  return if cleaner_struct.nil? || value.nil?
104
+
103
105
  # Duplicate value in case cleaner uses methods such as gsub!
104
106
  new_value = value.is_a?(String) ? value.dup : value
105
107
  cleaner_struct.cleaners.each do |name|
@@ -107,7 +109,6 @@ module DataCleansing
107
109
  end
108
110
  new_value
109
111
  end
110
-
111
112
  end
112
113
 
113
114
  module InstanceMethods
@@ -118,9 +119,9 @@ module DataCleansing
118
119
  #
119
120
  # Note: At this time the changes returned does not include any fields
120
121
  # modified in any of the after_cleaner methods
121
- def cleanse_attributes!(verbose=DataCleansing.logger.debug?)
122
+ def cleanse_attributes!(verbose = DataCleansing.logger.debug?)
122
123
  changes = {}
123
- DataCleansing.logger.benchmark_info("#{self.class.name}#cleanse_attributes!", :payload => changes) do
124
+ DataCleansing.logger.benchmark_info("#{self.class.name}#cleanse_attributes!", payload: changes) do
124
125
  # Collect parent cleaners first, starting with the top parent
125
126
  cleaners = [self.class.send(:data_cleansing_cleaners)]
126
127
  after_cleaners = [self.class.send(:data_cleansing_after_cleaners)]
@@ -194,36 +195,33 @@ module DataCleansing
194
195
  end
195
196
 
196
197
  # No need to clean if attribute is nil
197
- unless value.nil?
198
- new_value = self.class.send(:data_cleansing_clean, cleaner_struct, value, self)
199
-
200
- if new_value != value
201
- # Update value only if it has changed
202
- send("#{attr.to_sym}=".to_sym, new_value)
203
-
204
- # Capture changed attributes
205
- if changes
206
- # Mask sensitive attributes when logging
207
- masked = DataCleansing.masked_attributes.include?(attr.to_sym)
208
- new_value = :masked if masked && !new_value.nil?
209
- if previous = changes[attr.to_sym]
210
- previous[:after] = new_value
211
- else
212
- if new_value.nil? || verbose
213
- changes[attr.to_sym] = {
214
- :before => masked ? :masked : value,
215
- :after => new_value
216
- }
217
- end
218
- end
219
- end
220
- end
198
+ next if value.nil?
199
+
200
+ new_value = self.class.send(:data_cleansing_clean, cleaner_struct, value, self)
201
+
202
+ next unless new_value != value
203
+
204
+ # Update value only if it has changed
205
+ send("#{attr.to_sym}=".to_sym, new_value)
206
+
207
+ # Capture changed attributes
208
+ next unless changes
209
+
210
+ # Mask sensitive attributes when logging
211
+ masked = DataCleansing.masked_attributes.include?(attr.to_sym)
212
+ new_value = :masked if masked && !new_value.nil?
213
+ if previous = changes[attr.to_sym]
214
+ previous[:after] = new_value
215
+ elsif new_value.nil? || verbose
216
+ changes[attr.to_sym] = {
217
+ before: masked ? :masked : value,
218
+ after: new_value
219
+ }
221
220
  end
222
221
  end
223
222
  end
224
223
  changes
225
224
  end
226
-
227
225
  end
228
226
 
229
227
  def self.included(base)
@@ -233,5 +231,4 @@ module DataCleansing
233
231
  end
234
232
  end
235
233
  end
236
-
237
234
  end
@@ -9,6 +9,7 @@ module DataCleansing
9
9
  # Replaces any existing cleaner with the same name
10
10
  def self.register_cleaner(name, cleaner = nil, &block)
11
11
  raise "Must supply a Proc with the cleaner" unless block || cleaner
12
+
12
13
  @@global_cleaners[name.to_sym] = cleaner || block
13
14
  end
14
15
 
@@ -19,7 +20,7 @@ module DataCleansing
19
20
 
20
21
  # Register Attributes to be masked out in any log output
21
22
  def self.register_masked_attributes(*attributes)
22
- attributes.each {|attr| @@masked_attributes << attr.to_sym }
23
+ attributes.each { |attr| @@masked_attributes << attr.to_sym }
23
24
  end
24
25
 
25
26
  # Returns the Global list of attributes to mask in any log output
@@ -44,5 +45,4 @@ module DataCleansing
44
45
  (proc.method(:call).arity == 1 ? proc.call(value) : proc.call(value, params))
45
46
  end
46
47
  end
47
-
48
48
  end
@@ -1,6 +1,5 @@
1
1
  module RubySkynet #:nodoc:
2
2
  class Railtie < Rails::Railtie #:nodoc:
3
-
4
3
  # Exposes DataCleansing configuration to the Rails application configuration.
5
4
  #
6
5
  # @example Set up configuration in the Rails app.
@@ -1,3 +1,3 @@
1
1
  module DataCleansing
2
- VERSION = '1.0.2'
2
+ VERSION = "1.0.3"
3
3
  end
@@ -1,13 +1,11 @@
1
- require 'concurrent'
2
- require 'semantic_logger'
3
- require 'data_cleansing/version'
4
- require 'data_cleansing/data_cleansing'
1
+ require "concurrent"
2
+ require "semantic_logger"
3
+ require "data_cleansing/version"
4
+ require "data_cleansing/data_cleansing"
5
5
 
6
6
  module DataCleansing
7
- autoload :Cleanse, 'data_cleansing/cleanse'
7
+ autoload :Cleanse, "data_cleansing/cleanse"
8
8
  end
9
9
 
10
10
  # Rails Extensions
11
- if defined?(Rails)
12
- require 'data_cleansing/railtie'
13
- end
11
+ require "data_cleansing/railtie" if defined?(Rails)
@@ -1,19 +1,19 @@
1
- require_relative 'test_helper'
2
- require 'active_record'
1
+ require_relative "test_helper"
2
+ require "active_record"
3
3
 
4
4
  ActiveRecord::Base.logger = SemanticLogger[ActiveRecord::Base]
5
5
  ActiveRecord::Base.configurations = {
6
- 'test' => {
7
- 'adapter' => 'sqlite3',
8
- 'database' => 'test/test_db.sqlite3',
9
- 'pool' => 5,
10
- 'timeout' => 5000
6
+ "test" => {
7
+ "adapter" => "sqlite3",
8
+ "database" => "test/test_db.sqlite3",
9
+ "pool" => 5,
10
+ "timeout" => 5000
11
11
  }
12
12
  }
13
13
  ActiveRecord::Base.establish_connection(:test)
14
14
 
15
- ActiveRecord::Schema.define :version => 0 do
16
- create_table :users, :force => true do |t|
15
+ ActiveRecord::Schema.define version: 0 do
16
+ create_table :users, force: true do |t|
17
17
  t.string :first_name
18
18
  t.string :last_name
19
19
  t.string :address1
@@ -38,13 +38,13 @@ class User < ActiveRecord::Base
38
38
  attr_accessor :instance_var
39
39
 
40
40
  # Use a global cleaner
41
- cleanse :first_name, :last_name, :cleaner => :strip
41
+ cleanse :first_name, :last_name, cleaner: :strip
42
42
 
43
43
  # Define a once off cleaner
44
- cleanse :address1, :address2, :instance_var, :cleaner => Proc.new {|string| "<< #{string.strip} >>"}
44
+ cleanse :address1, :address2, :instance_var, cleaner: proc { |string| "<< #{string.strip} >>" }
45
45
 
46
46
  # Custom Zip Code cleaner
47
- cleanse :zip_code, :cleaner => :string_to_integer
47
+ cleanse :zip_code, cleaner: :string_to_integer
48
48
 
49
49
  # Automatically cleanse data before validation
50
50
  before_validation :cleanse_attributes!
@@ -53,107 +53,104 @@ end
53
53
  class User2 < ActiveRecord::Base
54
54
  include DataCleansing::Cleanse
55
55
  # Use the same table as User above
56
- self.table_name = 'users'
56
+ self.table_name = "users"
57
57
 
58
58
  serialize :text
59
59
 
60
60
  # Test :all cleaner. Only works with ActiveRecord Models
61
61
  # Must explicitly excelude :text since it is serialized
62
- cleanse :all, :cleaner => [:strip, Proc.new{|s| "@#{s}@"}], :except => [:address1, :zip_code, :text]
62
+ cleanse :all, cleaner: [:strip, proc { |s| "@#{s}@" }], except: %i[address1 zip_code text]
63
63
 
64
64
  # Clean :first_name multiple times
65
- cleanse :first_name, :cleaner => Proc.new {|string| "<< #{string} >>"}
65
+ cleanse :first_name, cleaner: proc { |string| "<< #{string} >>" }
66
66
 
67
67
  # Clean :first_name multiple times
68
- cleanse :first_name, :cleaner => Proc.new {|string| "$#{string}$"}
68
+ cleanse :first_name, cleaner: proc { |string| "$#{string}$" }
69
69
 
70
70
  # Custom Zip Code cleaner
71
- cleanse :zip_code, :cleaner => :string_to_integer
71
+ cleanse :zip_code, cleaner: :string_to_integer
72
72
 
73
73
  # Automatically cleanse data before validation
74
74
  before_validation :cleanse_attributes!
75
75
  end
76
76
 
77
77
  class ActiveRecordTest < Minitest::Test
78
- describe 'ActiveRecord Models' do
79
-
80
- it 'have globally registered cleaner' do
78
+ describe "ActiveRecord Models" do
79
+ it "have globally registered cleaner" do
81
80
  assert DataCleansing.cleaner(:strip)
82
81
  end
83
82
 
84
- it 'Model.cleanse_attribute' do
85
- assert_equal 'joe', User.cleanse_attribute(:first_name, ' joe ')
86
- assert_equal 'black', User.cleanse_attribute(:last_name, "\n black\n")
87
- assert_equal '<< 2632 Brown St >>', User.cleanse_attribute(:address1, "2632 Brown St \n")
88
- assert_equal '<< instance >>', User.cleanse_attribute(:instance_var, "\n instance\n\t ")
89
- assert_equal 12345, User.cleanse_attribute(:zip_code, "\n\tblah 12345badtext\n")
83
+ it "Model.cleanse_attribute" do
84
+ assert_equal "joe", User.cleanse_attribute(:first_name, " joe ")
85
+ assert_equal "black", User.cleanse_attribute(:last_name, "\n black\n")
86
+ assert_equal "<< 2632 Brown St >>", User.cleanse_attribute(:address1, "2632 Brown St \n")
87
+ assert_equal "<< instance >>", User.cleanse_attribute(:instance_var, "\n instance\n\t ")
88
+ assert_equal 12_345, User.cleanse_attribute(:zip_code, "\n\tblah 12345badtext\n")
90
89
  end
91
90
 
92
91
  describe "with user" do
93
92
  before do
94
93
  @user = User.new(
95
- :first_name => ' joe ',
96
- :last_name => "\n black\n",
97
- :address1 => "2632 Brown St \n",
98
- :zip_code => "\n\tblah 12345badtext\n",
99
- :instance_var => "\n instance\n\t "
94
+ first_name: " joe ",
95
+ last_name: "\n black\n",
96
+ address1: "2632 Brown St \n",
97
+ zip_code: "\n\tblah 12345badtext\n",
98
+ instance_var: "\n instance\n\t "
100
99
  )
101
100
  end
102
101
 
103
- it 'only have 3 cleaners' do
102
+ it "only have 3 cleaners" do
104
103
  assert_equal 3, User.send(:data_cleansing_cleaners).size, User.send(:data_cleansing_cleaners)
105
104
  end
106
105
 
107
- it 'cleanse_attributes! using global cleaner' do
106
+ it "cleanse_attributes! using global cleaner" do
108
107
  assert_equal true, @user.valid?
109
- assert_equal 'joe', @user.first_name
110
- assert_equal 'black', @user.last_name
108
+ assert_equal "joe", @user.first_name
109
+ assert_equal "black", @user.last_name
111
110
  end
112
111
 
113
- it 'cleanse_attributes! using attribute specific custom cleaner' do
112
+ it "cleanse_attributes! using attribute specific custom cleaner" do
114
113
  assert_equal true, @user.valid?
115
- assert_equal '<< 2632 Brown St >>', @user.address1
116
- assert_equal '<< instance >>', @user.instance_var
114
+ assert_equal "<< 2632 Brown St >>", @user.address1
115
+ assert_equal "<< instance >>", @user.instance_var
117
116
  end
118
117
 
119
- it 'cleanse_attributes! using global cleaner using rails extensions' do
118
+ it "cleanse_attributes! using global cleaner using rails extensions" do
120
119
  @user.cleanse_attributes!
121
- assert_equal 12345, @user.zip_code
120
+ assert_equal 12_345, @user.zip_code
122
121
  end
123
122
  end
124
123
 
125
- describe 'with user2' do
124
+ describe "with user2" do
126
125
  before do
127
126
  @user = User2.new(
128
- :first_name => ' joe ',
129
- :last_name => "\n black\n",
130
- :ssn => "\n 123456789 \n ",
131
- :address1 => "2632 Brown St \n",
132
- :zip_code => "\n\t blah\n",
133
- :text => ["\n 123456789 \n ", ' second ']
127
+ first_name: " joe ",
128
+ last_name: "\n black\n",
129
+ ssn: "\n 123456789 \n ",
130
+ address1: "2632 Brown St \n",
131
+ zip_code: "\n\t blah\n",
132
+ text: ["\n 123456789 \n ", " second "]
134
133
  )
135
134
  end
136
135
 
137
- it 'have 4 cleaners defined' do
136
+ it "have 4 cleaners defined" do
138
137
  assert_equal 4, User2.send(:data_cleansing_cleaners).size, User2.send(:data_cleansing_cleaners)
139
138
  end
140
139
 
141
- it 'have 3 attributes cleaners defined' do
140
+ it "have 3 attributes cleaners defined" do
142
141
  # :all, :first_name, :zip_code
143
142
  assert_equal 3, User2.send(:data_cleansing_attribute_cleaners).size, User2.send(:data_cleansing_attribute_cleaners)
144
143
  end
145
144
 
146
- it 'cleanse_attributes! clean all attributes' do
145
+ it "cleanse_attributes! clean all attributes" do
147
146
  assert_equal true, @user.valid?
148
- assert_equal '$<< @joe@ >>$', @user.first_name, User2.send(:data_cleansing_cleaners)
149
- assert_equal '@black@', @user.last_name
147
+ assert_equal "$<< @joe@ >>$", @user.first_name, User2.send(:data_cleansing_cleaners)
148
+ assert_equal "@black@", @user.last_name
150
149
  assert_equal "2632 Brown St \n", @user.address1
151
150
  assert_equal "@123456789@", @user.ssn
152
- assert_equal nil, @user.zip_code, User2.send(:data_cleansing_cleaners)
153
- assert_equal ["\n 123456789 \n ", ' second '], @user.text
151
+ assert_nil @user.zip_code, User2.send(:data_cleansing_cleaners)
152
+ assert_equal ["\n 123456789 \n ", " second "], @user.text
154
153
  end
155
-
156
154
  end
157
-
158
155
  end
159
156
  end
@@ -1,15 +1,15 @@
1
- require_relative 'test_helper'
2
- require 'active_support/core_ext/time/calculations'
1
+ require_relative "test_helper"
2
+ require "active_support/core_ext/time/calculations"
3
3
 
4
4
  class CleanersTest < Minitest::Test
5
5
  class User
6
6
  include DataCleansing::Cleanse
7
7
 
8
8
  attr_accessor :first_name, :last_name, :address1, :address2,
9
- :make_this_upper, :clean_non_word, :clean_non_printable,
10
- :clean_html, :clean_from_uri, :clean_to_uri, :clean_whitespace,
11
- :clean_digits_only, :clean_to_integer, :clean_to_float, :clean_end_of_day,
12
- :clean_order
9
+ :make_this_upper, :clean_non_word, :clean_non_printable,
10
+ :clean_html, :clean_from_uri, :clean_to_uri, :clean_whitespace,
11
+ :clean_digits_only, :clean_to_integer, :clean_to_float, :clean_end_of_day,
12
+ :clean_order
13
13
 
14
14
  cleanse :first_name, :last_name, :address1, :address2, cleaner: :strip
15
15
  cleanse :make_this_upper, cleaner: :upcase
@@ -25,197 +25,196 @@ class CleanersTest < Minitest::Test
25
25
  cleanse :clean_end_of_day, cleaner: :end_of_day
26
26
 
27
27
  # Call cleaners in the order they are defined
28
- cleanse :clean_order, cleaner: [:upcase, :strip]
29
- cleanse :clean_order, cleaner: -> val { val == 'BLAH' ? ' yes ' : ' no ' }
28
+ cleanse :clean_order, cleaner: %i[upcase strip]
29
+ cleanse :clean_order, cleaner: ->(val) { val == "BLAH" ? " yes " : " no " }
30
30
  end
31
31
 
32
- describe 'Cleaners' do
33
- it '#strip' do
32
+ describe "Cleaners" do
33
+ it "#strip" do
34
34
  user = User.new
35
- user.first_name = ' jack black '
35
+ user.first_name = " jack black "
36
36
  user.last_name = " \n \t joe"
37
37
  user.address1 = "joe \n\n \n \t\t "
38
38
  user.address2 = "joe \n\n bloggs \n \t\t "
39
39
  user.cleanse_attributes!
40
- assert_equal 'jack black', user.first_name
41
- assert_equal 'joe', user.last_name
42
- assert_equal 'joe', user.address1
40
+ assert_equal "jack black", user.first_name
41
+ assert_equal "joe", user.last_name
42
+ assert_equal "joe", user.address1
43
43
  assert_equal "joe \n\n bloggs", user.address2
44
44
  end
45
45
 
46
- it '#upcase' do
46
+ it "#upcase" do
47
47
  user = User.new
48
- user.make_this_upper = ' jacK blAck '
48
+ user.make_this_upper = " jacK blAck "
49
49
  user.cleanse_attributes!
50
- assert_equal ' JACK BLACK ', user.make_this_upper
50
+ assert_equal " JACK BLACK ", user.make_this_upper
51
51
  end
52
52
 
53
- it '#remove_non_word' do
53
+ it "#remove_non_word" do
54
54
  user = User.new
55
55
  user.clean_non_word = " !@#$%^&*()+=-~`\t\n jacK blAck <>.,/\"':;{][]\|?/\\ "
56
56
  user.cleanse_attributes!
57
- assert_equal 'jacKblAck', user.clean_non_word
57
+ assert_equal "jacKblAck", user.clean_non_word
58
58
  end
59
59
 
60
- it '#remove_non_printable' do
60
+ it "#remove_non_printable" do
61
61
  user = User.new
62
- user.clean_non_printable = " !@#$%^&*()+=-~`\t\n jacK blAck <>.,/\"':;{][]\|?/\\ "
62
+ user.clean_non_printable = " !@#$%^&*()+=-~`\t\n jacK blAck <>.,/\"':;{][]\|?/\\ \x89 "
63
63
  user.cleanse_attributes!
64
64
  assert_equal " !@#$%^&*()+=-~` jacK blAck <>.,/\"':;{][]\|?/\\ ", user.clean_non_printable
65
65
  end
66
66
 
67
- describe '#clean_html' do
68
- it 'cleans &quot;' do
67
+ describe "#clean_html" do
68
+ it "cleans &quot;" do
69
69
  user = User.new
70
- user.clean_html = 'O&quot;Leary'
70
+ user.clean_html = "O&quot;Leary"
71
71
  user.cleanse_attributes!
72
72
  assert_equal 'O"Leary', user.clean_html
73
73
  end
74
74
 
75
- it 'cleans &amp;' do
75
+ it "cleans &amp;" do
76
76
  user = User.new
77
- user.clean_html = 'Jim &amp; Candi'
77
+ user.clean_html = "Jim &amp; Candi"
78
78
  user.cleanse_attributes!
79
- assert_equal 'Jim & Candi', user.clean_html
79
+ assert_equal "Jim & Candi", user.clean_html
80
80
  end
81
81
 
82
- it 'cleans &gt;' do
82
+ it "cleans &gt;" do
83
83
  user = User.new
84
- user.clean_html = '2 &gt; 1'
84
+ user.clean_html = "2 &gt; 1"
85
85
  user.cleanse_attributes!
86
- assert_equal '2 > 1', user.clean_html
86
+ assert_equal "2 > 1", user.clean_html
87
87
  end
88
88
 
89
- it 'cleans &lt;' do
89
+ it "cleans &lt;" do
90
90
  user = User.new
91
- user.clean_html = '1 &lt; 2'
91
+ user.clean_html = "1 &lt; 2"
92
92
  user.cleanse_attributes!
93
- assert_equal '1 < 2', user.clean_html
93
+ assert_equal "1 < 2", user.clean_html
94
94
  end
95
95
 
96
- it 'cleans &apos;' do
96
+ it "cleans &apos;" do
97
97
  user = User.new
98
- user.clean_html = '1&apos;2'
98
+ user.clean_html = "1&apos;2"
99
99
  user.cleanse_attributes!
100
100
  assert_equal "1'2", user.clean_html
101
101
  end
102
102
 
103
- it 'cleans &nbsp;' do
103
+ it "cleans &nbsp;" do
104
104
  user = User.new
105
- user.clean_html = '1&nbsp;2'
105
+ user.clean_html = "1&nbsp;2"
106
106
  user.cleanse_attributes!
107
107
  assert_equal "1 2", user.clean_html
108
108
  end
109
109
 
110
- it 'cleans &AMP;' do
110
+ it "cleans &AMP;" do
111
111
  user = User.new
112
- user.clean_html = 'Mutt &AMP; Jeff Inc.'
112
+ user.clean_html = "Mutt &AMP; Jeff Inc."
113
113
  user.cleanse_attributes!
114
- assert_equal 'Mutt & Jeff Inc.', user.clean_html
114
+ assert_equal "Mutt & Jeff Inc.", user.clean_html
115
115
  end
116
116
 
117
- it 'does not clean &;' do
117
+ it "does not clean &;" do
118
118
  user = User.new
119
- user.clean_html = 'Mutt &; Jeff Inc.'
119
+ user.clean_html = "Mutt &; Jeff Inc."
120
120
  user.cleanse_attributes!
121
- assert_equal 'Mutt &; Jeff Inc.', user.clean_html
121
+ assert_equal "Mutt &; Jeff Inc.", user.clean_html
122
122
  end
123
123
 
124
- it 'does not clean &blah;' do
124
+ it "does not clean &blah;" do
125
125
  user = User.new
126
- user.clean_html = '1&blah;2'
126
+ user.clean_html = "1&blah;2"
127
127
  user.cleanse_attributes!
128
- assert_equal '1&blah;2', user.clean_html
128
+ assert_equal "1&blah;2", user.clean_html
129
129
  end
130
130
  end
131
131
 
132
- describe '#unescape_uri' do
133
- it 'converts %20' do
132
+ describe "#unescape_uri" do
133
+ it "converts %20" do
134
134
  user = User.new
135
- user.clean_from_uri = 'Jim%20%20Bob%20'
135
+ user.clean_from_uri = "Jim%20%20Bob%20"
136
136
  user.cleanse_attributes!
137
- assert_equal 'Jim Bob ', user.clean_from_uri
137
+ assert_equal "Jim Bob ", user.clean_from_uri
138
138
  end
139
- it 'converts %20 only' do
139
+ it "converts %20 only" do
140
140
  user = User.new
141
- user.clean_from_uri = '%20'
141
+ user.clean_from_uri = "%20"
142
142
  user.cleanse_attributes!
143
- assert_equal ' ', user.clean_from_uri
143
+ assert_equal " ", user.clean_from_uri
144
144
  end
145
145
  end
146
146
 
147
- describe '#escape_uri' do
148
- it 'converts spaces' do
147
+ describe "#escape_uri" do
148
+ it "converts spaces" do
149
149
  user = User.new
150
- user.clean_to_uri = 'Jim Bob '
150
+ user.clean_to_uri = "Jim Bob "
151
151
  user.cleanse_attributes!
152
- assert_equal 'Jim++Bob+', user.clean_to_uri
152
+ assert_equal "Jim++Bob+", user.clean_to_uri
153
153
  end
154
- it 'converts space only' do
154
+ it "converts space only" do
155
155
  user = User.new
156
- user.clean_to_uri = ' '
156
+ user.clean_to_uri = " "
157
157
  user.cleanse_attributes!
158
- assert_equal '+', user.clean_to_uri
158
+ assert_equal "+", user.clean_to_uri
159
159
  end
160
160
  end
161
161
 
162
- describe '#compress_whitespace' do
163
- it 'compresses multiple spaces' do
162
+ describe "#compress_whitespace" do
163
+ it "compresses multiple spaces" do
164
164
  user = User.new
165
- user.clean_whitespace = ' J im B ob '
165
+ user.clean_whitespace = " J im B ob "
166
166
  user.cleanse_attributes!
167
- assert_equal ' J im B ob ', user.clean_whitespace
167
+ assert_equal " J im B ob ", user.clean_whitespace
168
168
  end
169
169
 
170
- it 'does not compress single spaces' do
170
+ it "does not compress single spaces" do
171
171
  user = User.new
172
- user.clean_whitespace = ' Jack Black'
172
+ user.clean_whitespace = " Jack Black"
173
173
  user.cleanse_attributes!
174
- assert_equal ' Jack Black', user.clean_whitespace
174
+ assert_equal " Jack Black", user.clean_whitespace
175
175
  end
176
176
 
177
- it 'compresses newlines and tabs' do
177
+ it "compresses newlines and tabs" do
178
178
  user = User.new
179
179
  user.clean_whitespace = " \n\n J im B ob \t\n\t "
180
180
  user.cleanse_attributes!
181
- assert_equal ' J im B ob ', user.clean_whitespace
181
+ assert_equal " J im B ob ", user.clean_whitespace
182
182
  end
183
183
  end
184
184
 
185
- it '#digits_only' do
185
+ it "#digits_only" do
186
186
  user = User.new
187
187
  user.clean_digits_only = " 1 !@#$%^&*3()+=-~`\t\n jacK6 blAck <>.,/\"':;8{][]9\|?/\\ "
188
188
  user.cleanse_attributes!
189
- assert_equal '13689', user.clean_digits_only
189
+ assert_equal "13689", user.clean_digits_only
190
190
  end
191
191
 
192
- it '#string_to_integer' do
192
+ it "#string_to_integer" do
193
193
  user = User.new
194
194
  user.clean_to_integer = " 1 !@#$%^&*3()+=-~`\t\n jacK6 blAck <>.,/\"':;8{][]9\|?/\\ "
195
195
  user.cleanse_attributes!
196
196
  assert_equal 136, user.clean_to_integer
197
197
  end
198
198
 
199
- it '#string_to_float' do
199
+ it "#string_to_float" do
200
200
  user = User.new
201
201
  user.clean_to_float = " 1 !@#$%^&*3()+=-~`\t\n jacK6 blAck <>.,/\"':;8{][]9\|?/\\ "
202
202
  user.cleanse_attributes!
203
203
  assert_equal 136.89, user.clean_to_float
204
204
  end
205
205
 
206
- it '#date_to_time_at_end_of_day' do
206
+ it "#date_to_time_at_end_of_day" do
207
207
  user = User.new
208
- user.clean_end_of_day = Time.parse('2016-03-03 14:33:44 +0000')
208
+ user.clean_end_of_day = Time.parse("2016-03-03 14:33:44 +0000")
209
209
  user.cleanse_attributes!
210
- assert_equal Time.parse('2016-03-03 23:59:59 +0000').to_i, user.clean_end_of_day.to_i
210
+ assert_equal Time.parse("2016-03-03 23:59:59 +0000").to_i, user.clean_end_of_day.to_i
211
211
  end
212
212
 
213
- it 'cleans in the order defined' do
213
+ it "cleans in the order defined" do
214
214
  user = User.new
215
- user.clean_order = ' blah '
215
+ user.clean_order = " blah "
216
216
  user.cleanse_attributes!
217
- assert_equal ' yes ', user.clean_order
217
+ assert_equal " yes ", user.clean_order
218
218
  end
219
-
220
219
  end
221
220
  end
@@ -1,9 +1,9 @@
1
- require_relative 'test_helper'
1
+ require_relative "test_helper"
2
2
 
3
3
  class DataCleansingTest < Minitest::Test
4
- describe '#clean' do
5
- it 'can call any cleaner directly' do
6
- assert_equal 'jack black', DataCleansing.clean(:strip, ' jack black ')
4
+ describe "#clean" do
5
+ it "can call any cleaner directly" do
6
+ assert_equal "jack black", DataCleansing.clean(:strip, " jack black ")
7
7
  end
8
8
  end
9
9
  end
data/test/ruby_test.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative 'test_helper'
1
+ require_relative "test_helper"
2
2
 
3
3
  # Non Cleansing base class
4
4
  class RubyUserBase
@@ -11,10 +11,10 @@ class RubyUser < RubyUserBase
11
11
  attr_accessor :first_name, :last_name, :address1, :address2
12
12
 
13
13
  # Use a global cleaner
14
- cleanse :first_name, :last_name, :cleaner => :strip
14
+ cleanse :first_name, :last_name, cleaner: :strip
15
15
 
16
16
  # Define a once off cleaner
17
- cleanse :address1, :address2, :cleaner => Proc.new {|string| "<< #{string.strip} >>"}
17
+ cleanse :address1, :address2, cleaner: proc { |string| "<< #{string.strip} >>" }
18
18
 
19
19
  # Execute after cleanser
20
20
  after_cleanse :name_check
@@ -31,7 +31,8 @@ end
31
31
 
32
32
  class RubyUserChild < RubyUser
33
33
  attr_accessor :gender
34
- cleanse :gender, :cleaner => Proc.new {|gender| gender.to_s.strip.downcase}
34
+
35
+ cleanse :gender, cleaner: proc { |gender| gender.to_s.strip.downcase }
35
36
  end
36
37
 
37
38
  class RubyUser2
@@ -40,20 +41,20 @@ class RubyUser2
40
41
  attr_accessor :first_name, :last_name, :title, :address1, :address2, :gender
41
42
 
42
43
  # Use a global cleaner
43
- cleanse :first_name, :last_name, :cleaner => :strip
44
+ cleanse :first_name, :last_name, cleaner: :strip
44
45
 
45
46
  # Define a once off cleaner
46
- cleanse :address1, :address2, :cleaner => Proc.new {|string| string.strip}
47
+ cleanse :address1, :address2, cleaner: proc { |string| string.strip }
47
48
 
48
49
  # Use multiple cleaners, and a custom block
49
- cleanse :title, :cleaner => [:strip, :upcase, Proc.new {|string| "#{string}." unless string.end_with?('.')}]
50
+ cleanse :title, cleaner: [:strip, :upcase, proc { |string| "#{string}." unless string.end_with?(".") }]
50
51
 
51
52
  # Change the cleansing rule based on the value of other attributes in that instance of user
52
53
  # The 'title' is retrieved from the current instance of the user
53
- cleanse :gender, :cleaner => [
54
+ cleanse :gender, cleaner: [
54
55
  :strip,
55
56
  :upcase,
56
- Proc.new do |gender|
57
+ proc do |gender|
57
58
  if (gender == "UNKNOWN") && (title == "MR.")
58
59
  "Male"
59
60
  else
@@ -65,113 +66,110 @@ end
65
66
 
66
67
  class RubyTest < Minitest::Test
67
68
  describe "Ruby Models" do
68
-
69
- it 'have globally registered cleaner' do
69
+ it "have globally registered cleaner" do
70
70
  assert DataCleansing.cleaner(:strip)
71
71
  end
72
72
 
73
- it 'Model.cleanse_attribute' do
74
- assert_equal 'male', RubyUserChild.cleanse_attribute(:gender, "\n Male \n"), RubyUserChild.send(:data_cleansing_attribute_cleaners)
75
- assert_equal 'joe', RubyUserChild.cleanse_attribute(:first_name, ' joe '), RubyUserChild.send(:data_cleansing_attribute_cleaners)
76
- assert_equal 'black', RubyUserChild.cleanse_attribute(:last_name, "\n black\n"), RubyUserChild.send(:data_cleansing_attribute_cleaners)
77
- assert_equal '<< 2632 Brown St >>', RubyUserChild.cleanse_attribute(:address1, "2632 Brown St \n"), RubyUserChild.send(:data_cleansing_attribute_cleaners)
73
+ it "Model.cleanse_attribute" do
74
+ assert_equal "male", RubyUserChild.cleanse_attribute(:gender, "\n Male \n"), RubyUserChild.send(:data_cleansing_attribute_cleaners)
75
+ assert_equal "joe", RubyUserChild.cleanse_attribute(:first_name, " joe "), RubyUserChild.send(:data_cleansing_attribute_cleaners)
76
+ assert_equal "black", RubyUserChild.cleanse_attribute(:last_name, "\n black\n"), RubyUserChild.send(:data_cleansing_attribute_cleaners)
77
+ assert_equal "<< 2632 Brown St >>", RubyUserChild.cleanse_attribute(:address1, "2632 Brown St \n"), RubyUserChild.send(:data_cleansing_attribute_cleaners)
78
78
  assert_equal 3, RubyUserChild.cleanse_attribute(:first_name, 3), RubyUserChild.send(:data_cleansing_attribute_cleaners)
79
79
  end
80
80
 
81
81
  describe "with ruby user" do
82
82
  before do
83
83
  @user = RubyUser.new
84
- @user.first_name = ' joe '
84
+ @user.first_name = " joe "
85
85
  @user.last_name = "\n black\n"
86
86
  @user.address1 = "2632 Brown St \n"
87
87
  end
88
88
 
89
- it 'cleanse_attributes! using global cleaner' do
89
+ it "cleanse_attributes! using global cleaner" do
90
90
  @user.cleanse_attributes!
91
- assert_equal 'joe', @user.first_name
92
- assert_equal 'black', @user.last_name
91
+ assert_equal "joe", @user.first_name
92
+ assert_equal "black", @user.last_name
93
93
  end
94
94
 
95
- it 'cleanse_attributes! using attribute specific custom cleaner' do
95
+ it "cleanse_attributes! using attribute specific custom cleaner" do
96
96
  @user.cleanse_attributes!
97
- assert_equal '<< 2632 Brown St >>', @user.address1
97
+ assert_equal "<< 2632 Brown St >>", @user.address1
98
98
  end
99
99
 
100
- it 'cleanse_attributes! not cleanse nil attributes' do
100
+ it "cleanse_attributes! not cleanse nil attributes" do
101
101
  @user.first_name = nil
102
102
  @user.cleanse_attributes!
103
- assert_equal nil, @user.first_name
103
+ assert_nil @user.first_name
104
104
  end
105
105
 
106
- it 'cleanse_attributes! call after cleaner' do
107
- @user.first_name = 'Jack'
106
+ it "cleanse_attributes! call after cleaner" do
107
+ @user.first_name = "Jack"
108
108
  @user.last_name = nil
109
109
  @user.cleanse_attributes!
110
- assert_equal nil, @user.first_name, @user.inspect
111
- assert_equal 'Jack', @user.last_name, @user.inspect
110
+ assert_nil @user.first_name, @user.inspect
111
+ assert_equal "Jack", @user.last_name, @user.inspect
112
112
  end
113
113
  end
114
114
 
115
115
  describe "with ruby user child" do
116
116
  before do
117
117
  @user = RubyUserChild.new
118
- @user.first_name = ' joe '
118
+ @user.first_name = " joe "
119
119
  @user.last_name = "\n black\n"
120
120
  @user.address1 = "2632 Brown St \n"
121
121
  @user.gender = "\n Male \n"
122
122
  end
123
123
 
124
- it 'cleanse_attributes! using global cleaner' do
124
+ it "cleanse_attributes! using global cleaner" do
125
125
  @user.cleanse_attributes!
126
- assert_equal 'joe', @user.first_name
127
- assert_equal 'black', @user.last_name
126
+ assert_equal "joe", @user.first_name
127
+ assert_equal "black", @user.last_name
128
128
  end
129
129
 
130
- it 'cleanse_attributes! using attribute specific custom cleaner' do
130
+ it "cleanse_attributes! using attribute specific custom cleaner" do
131
131
  @user.cleanse_attributes!
132
- assert_equal '<< 2632 Brown St >>', @user.address1
132
+ assert_equal "<< 2632 Brown St >>", @user.address1
133
133
  end
134
134
 
135
- it 'cleanse_attributes! not cleanse nil attributes' do
135
+ it "cleanse_attributes! not cleanse nil attributes" do
136
136
  @user.first_name = nil
137
137
  @user.cleanse_attributes!
138
- assert_equal nil, @user.first_name
138
+ assert_nil @user.first_name
139
139
  end
140
140
 
141
- it 'cleanse_attributes! clean child attributes' do
141
+ it "cleanse_attributes! clean child attributes" do
142
142
  @user.cleanse_attributes!
143
- assert_equal 'male', @user.gender
143
+ assert_equal "male", @user.gender
144
144
  end
145
-
146
145
  end
147
146
 
148
147
  describe "with ruby user2" do
149
148
  before do
150
149
  @user = RubyUser2.new
151
- @user.first_name = ' joe '
150
+ @user.first_name = " joe "
152
151
  @user.last_name = "\n black\n"
153
152
  @user.address1 = "2632 Brown St \n"
154
153
  @user.title = " \nmr \n"
155
154
  @user.gender = " Unknown "
156
155
  end
157
156
 
158
- it 'cleanse_attributes!' do
157
+ it "cleanse_attributes!" do
159
158
  @user.cleanse_attributes!
160
- assert_equal 'joe', @user.first_name
161
- assert_equal 'black', @user.last_name
162
- assert_equal '2632 Brown St', @user.address1
159
+ assert_equal "joe", @user.first_name
160
+ assert_equal "black", @user.last_name
161
+ assert_equal "2632 Brown St", @user.address1
163
162
  end
164
163
 
165
- it 'cleanse_attributes! with multiple cleaners' do
164
+ it "cleanse_attributes! with multiple cleaners" do
166
165
  @user.cleanse_attributes!
167
- assert_equal 'MR.', @user.title
166
+ assert_equal "MR.", @user.title
168
167
  end
169
168
 
170
- it 'cleanse_attributes! referencing other attributes' do
169
+ it "cleanse_attributes! referencing other attributes" do
171
170
  @user.cleanse_attributes!
172
- assert_equal 'Male', @user.gender
171
+ assert_equal "Male", @user.gender
173
172
  end
174
173
  end
175
-
176
174
  end
177
175
  end
data/test/test_db.sqlite3 CHANGED
Binary file
data/test/test_helper.rb CHANGED
@@ -1,9 +1,9 @@
1
- ENV['RAILS_ENV'] = 'test'
1
+ ENV["RAILS_ENV"] = "test"
2
2
 
3
- require 'active_record'
4
- require 'minitest/autorun'
5
- require 'data_cleansing'
6
- require 'awesome_print'
3
+ require "active_record"
4
+ require "minitest/autorun"
5
+ require "data_cleansing"
6
+ require "amazing_print"
7
7
 
8
- SemanticLogger.add_appender(file_name: 'test.log', formatter: :color)
8
+ SemanticLogger.add_appender(file_name: "test.log", formatter: :color)
9
9
  SemanticLogger.default_level = :debug
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_cleansing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-22 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -38,9 +38,8 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.0'
41
- description:
41
+ description:
42
42
  email:
43
- - reidmo@gmail.com
44
43
  executables: []
45
44
  extensions: []
46
45
  extra_rdoc_files: []
@@ -64,7 +63,7 @@ homepage: http://github.com/reidmorrison/data_cleansing
64
63
  licenses:
65
64
  - Apache-2.0
66
65
  metadata: {}
67
- post_install_message:
66
+ post_install_message:
68
67
  rdoc_options: []
69
68
  require_paths:
70
69
  - lib
@@ -72,21 +71,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - ">="
74
73
  - !ruby/object:Gem::Version
75
- version: '0'
74
+ version: '2.3'
76
75
  required_rubygems_version: !ruby/object:Gem::Requirement
77
76
  requirements:
78
77
  - - ">="
79
78
  - !ruby/object:Gem::Version
80
79
  version: '0'
81
80
  requirements: []
82
- rubygems_version: 3.0.3
83
- signing_key:
81
+ rubygems_version: 3.2.22
82
+ signing_key:
84
83
  specification_version: 4
85
84
  summary: Data Cleansing framework for Ruby, Rails, and Mongoid.
86
85
  test_files:
87
- - test/test_db.sqlite3
88
- - test/data_cleansing_test.rb
89
86
  - test/active_record_test.rb
87
+ - test/cleaners_test.rb
88
+ - test/data_cleansing_test.rb
90
89
  - test/ruby_test.rb
90
+ - test/test_db.sqlite3
91
91
  - test/test_helper.rb
92
- - test/cleaners_test.rb