normalizy 1.3.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +59 -24
- data/README.md +22 -16
- data/lib/normalizy/filters/date.rb +2 -4
- data/lib/normalizy/filters/money.rb +2 -2
- data/lib/normalizy/filters/percent.rb +2 -2
- data/lib/normalizy/version.rb +1 -1
- metadata +27 -94
- data/spec/normalizy/config/add_spec.rb +0 -21
- data/spec/normalizy/config/alias_spec.rb +0 -29
- data/spec/normalizy/config/default_filters_spec.rb +0 -19
- data/spec/normalizy/config/initialize_spec.rb +0 -16
- data/spec/normalizy/config/normalizy_aliases_spec.rb +0 -9
- data/spec/normalizy/extensions/filters/date_spec.rb +0 -24
- data/spec/normalizy/extensions/filters/money_spec.rb +0 -38
- data/spec/normalizy/extensions/filters/number_spec.rb +0 -9
- data/spec/normalizy/extensions/filters/percent_spec.rb +0 -30
- data/spec/normalizy/extensions/filters/slug_spec.rb +0 -14
- data/spec/normalizy/extensions/filters/strip_spec.rb +0 -21
- data/spec/normalizy/extensions/model_spec.rb +0 -107
- data/spec/normalizy/extensions/normalizy_rules_spec.rb +0 -198
- data/spec/normalizy/filters/date_spec.rb +0 -50
- data/spec/normalizy/filters/money_spec.rb +0 -282
- data/spec/normalizy/filters/number_spec.rb +0 -33
- data/spec/normalizy/filters/percent_spec.rb +0 -168
- data/spec/normalizy/filters/slug_spec.rb +0 -24
- data/spec/normalizy/filters/strip_spec.rb +0 -13
- data/spec/normalizy/normalizy/configure_spec.rb +0 -11
- data/spec/normalizy/rspec/matcher/description_spec.rb +0 -27
- data/spec/normalizy/rspec/matcher/failure_message_spec.rb +0 -48
- data/spec/normalizy/rspec/matcher/failure_message_when_negated_spec.rb +0 -30
- data/spec/normalizy/rspec/matcher/from_spec.rb +0 -19
- data/spec/normalizy/rspec/matcher/matches_spec.rb +0 -117
- data/spec/normalizy/rspec/matcher/to_spec.rb +0 -19
- data/spec/rails_helper.rb +0 -9
- data/spec/support/common.rb +0 -11
- data/spec/support/db/schema.rb +0 -81
- data/spec/support/filters/blacklist.rb +0 -11
- data/spec/support/filters/block.rb +0 -11
- data/spec/support/filters/info.rb +0 -11
- data/spec/support/models/alias.rb +0 -7
- data/spec/support/models/match.rb +0 -9
- data/spec/support/models/model.rb +0 -28
- data/spec/support/models/model_date.rb +0 -7
- data/spec/support/models/model_money.rb +0 -10
- data/spec/support/models/model_number.rb +0 -5
- data/spec/support/models/model_percent.rb +0 -10
- data/spec/support/models/model_slug.rb +0 -6
- data/spec/support/models/model_strip.rb +0 -8
- data/spec/support/models/rule.rb +0 -4
@@ -1,10 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class ModelMoney < ActiveRecord::Base
|
4
|
-
normalizy :text , with: :money
|
5
|
-
normalizy :cents_type , with: { money: { type: :cents } }
|
6
|
-
normalizy :cast_to_i , with: { money: { cast: :to_i } }
|
7
|
-
normalizy :cast_to_d , with: { money: { cast: :to_d } }
|
8
|
-
normalizy :cents_type_and_cast_to_f, with: { money: { cast: :to_f, type: :cents } }
|
9
|
-
normalizy :cents_type_and_cast_to_i, with: { money: { cast: :to_i, type: :cents } }
|
10
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class ModelPercent < ActiveRecord::Base
|
4
|
-
normalizy :text , with: :percent
|
5
|
-
normalizy :cents_type , with: { percent: { type: :cents } }
|
6
|
-
normalizy :cast_to_i , with: { percent: { cast: :to_i } }
|
7
|
-
normalizy :cast_to_d , with: { percent: { cast: :to_d } }
|
8
|
-
normalizy :cents_type_and_cast_to_f, with: { percent: { cast: :to_f, type: :cents } }
|
9
|
-
normalizy :cents_type_and_cast_to_i, with: { percent: { cast: :to_i, type: :cents } }
|
10
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class ModelStrip < ActiveRecord::Base
|
4
|
-
normalizy :strip , with: :strip
|
5
|
-
normalizy :strip_side_both , with: { strip: { side: :both } }
|
6
|
-
normalizy :strip_side_left , with: { strip: { side: :left } }
|
7
|
-
normalizy :strip_side_right, with: { strip: { side: :right } }
|
8
|
-
end
|
data/spec/support/models/rule.rb
DELETED