normalizy 1.3.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +59 -24
  3. data/README.md +22 -16
  4. data/lib/normalizy/filters/date.rb +2 -4
  5. data/lib/normalizy/filters/money.rb +2 -2
  6. data/lib/normalizy/filters/percent.rb +2 -2
  7. data/lib/normalizy/version.rb +1 -1
  8. metadata +27 -94
  9. data/spec/normalizy/config/add_spec.rb +0 -21
  10. data/spec/normalizy/config/alias_spec.rb +0 -29
  11. data/spec/normalizy/config/default_filters_spec.rb +0 -19
  12. data/spec/normalizy/config/initialize_spec.rb +0 -16
  13. data/spec/normalizy/config/normalizy_aliases_spec.rb +0 -9
  14. data/spec/normalizy/extensions/filters/date_spec.rb +0 -24
  15. data/spec/normalizy/extensions/filters/money_spec.rb +0 -38
  16. data/spec/normalizy/extensions/filters/number_spec.rb +0 -9
  17. data/spec/normalizy/extensions/filters/percent_spec.rb +0 -30
  18. data/spec/normalizy/extensions/filters/slug_spec.rb +0 -14
  19. data/spec/normalizy/extensions/filters/strip_spec.rb +0 -21
  20. data/spec/normalizy/extensions/model_spec.rb +0 -107
  21. data/spec/normalizy/extensions/normalizy_rules_spec.rb +0 -198
  22. data/spec/normalizy/filters/date_spec.rb +0 -50
  23. data/spec/normalizy/filters/money_spec.rb +0 -282
  24. data/spec/normalizy/filters/number_spec.rb +0 -33
  25. data/spec/normalizy/filters/percent_spec.rb +0 -168
  26. data/spec/normalizy/filters/slug_spec.rb +0 -24
  27. data/spec/normalizy/filters/strip_spec.rb +0 -13
  28. data/spec/normalizy/normalizy/configure_spec.rb +0 -11
  29. data/spec/normalizy/rspec/matcher/description_spec.rb +0 -27
  30. data/spec/normalizy/rspec/matcher/failure_message_spec.rb +0 -48
  31. data/spec/normalizy/rspec/matcher/failure_message_when_negated_spec.rb +0 -30
  32. data/spec/normalizy/rspec/matcher/from_spec.rb +0 -19
  33. data/spec/normalizy/rspec/matcher/matches_spec.rb +0 -117
  34. data/spec/normalizy/rspec/matcher/to_spec.rb +0 -19
  35. data/spec/rails_helper.rb +0 -9
  36. data/spec/support/common.rb +0 -11
  37. data/spec/support/db/schema.rb +0 -81
  38. data/spec/support/filters/blacklist.rb +0 -11
  39. data/spec/support/filters/block.rb +0 -11
  40. data/spec/support/filters/info.rb +0 -11
  41. data/spec/support/models/alias.rb +0 -7
  42. data/spec/support/models/match.rb +0 -9
  43. data/spec/support/models/model.rb +0 -28
  44. data/spec/support/models/model_date.rb +0 -7
  45. data/spec/support/models/model_money.rb +0 -10
  46. data/spec/support/models/model_number.rb +0 -5
  47. data/spec/support/models/model_percent.rb +0 -10
  48. data/spec/support/models/model_slug.rb +0 -6
  49. data/spec/support/models/model_strip.rb +0 -8
  50. 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,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ModelNumber < ActiveRecord::Base
4
- normalizy :number, with: :number
5
- 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,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ModelSlug < ActiveRecord::Base
4
- normalizy :permalink, with: :slug
5
- normalizy :title , with: { slug: { to: :slug } }
6
- 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
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Rule < ActiveRecord::Base
4
- end