commons_yellowme 0.11.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +62 -0
  3. data/.rspec +3 -0
  4. data/Gemfile +12 -0
  5. data/Gemfile.lock +218 -0
  6. data/bin/test +5 -0
  7. data/commons.gemspec +36 -0
  8. data/lib/commons.rb +1 -1
  9. data/lib/commons/concerns/extensions/soft_deleted.rb +34 -0
  10. data/lib/commons/formatter/regex_constants.rb +2 -0
  11. data/lib/commons/repositories/base_repository.rb +59 -54
  12. data/lib/commons/services/concerns/callable.rb +7 -2
  13. data/lib/commons/version.rb +1 -1
  14. data/spec/commons/authentication/authenticate_by_jwt_spec.rb +37 -0
  15. data/spec/commons/authentication/json_web_token_spec.rb +41 -0
  16. data/spec/commons/concerns/attributes/sex_spec.rb +24 -0
  17. data/spec/commons/concerns/extensions/deleted_spec.rb +40 -0
  18. data/spec/commons/concerns/guard/capitalizable_spec.rb +13 -0
  19. data/spec/commons/concerns/validations/undestroyable_spec.rb +9 -0
  20. data/spec/commons/errors/bad_request_spec.rb +62 -0
  21. data/spec/commons/errors/conflict_spec.rb +62 -0
  22. data/spec/commons/errors/forbidden_spec.rb +62 -0
  23. data/spec/commons/errors/internal_server_error_spec.rb +62 -0
  24. data/spec/commons/errors/invalid_resource_spec.rb +62 -0
  25. data/spec/commons/errors/maintenance_mode_spec.rb +49 -0
  26. data/spec/commons/errors/missing_parameter_spec.rb +49 -0
  27. data/spec/commons/errors/not_unique_spec.rb +62 -0
  28. data/spec/commons/errors/payment_required_spec.rb +62 -0
  29. data/spec/commons/errors/precondition_failed_spec.rb +62 -0
  30. data/spec/commons/errors/resource_not_found_spec.rb +49 -0
  31. data/spec/commons/errors/route_not_found_spec.rb +49 -0
  32. data/spec/commons/errors/unauthorized_spec.rb +62 -0
  33. data/spec/commons/errors/unprocessable_entity_spec.rb +62 -0
  34. data/spec/commons/formatter/e164_phone_spec.rb +155 -0
  35. data/spec/commons/formatter/regex_constants_spec.rb +165 -0
  36. data/spec/commons/formatter/string_utils_spec.rb +19 -0
  37. data/spec/commons/repositories/base_repository_spec.rb +516 -0
  38. data/spec/commons/repositories/catalogs/base_catalog_spec.rb +55 -0
  39. data/spec/commons/serializers/bad_request_spec.rb +46 -0
  40. data/spec/commons/serializers/conflict_spec.rb +46 -0
  41. data/spec/commons/serializers/forbidden_spec.rb +46 -0
  42. data/spec/commons/serializers/internal_server_error_spec.rb +46 -0
  43. data/spec/commons/serializers/invalid_resource_spec.rb +46 -0
  44. data/spec/commons/serializers/maintenance_mode_spec.rb +46 -0
  45. data/spec/commons/serializers/missing_parameter_spec.rb +44 -0
  46. data/spec/commons/serializers/not_unique_spec.rb +46 -0
  47. data/spec/commons/serializers/payment_required_spec.rb +46 -0
  48. data/spec/commons/serializers/precondition_failed_spec.rb +46 -0
  49. data/spec/commons/serializers/route_not_found_spec.rb +46 -0
  50. data/spec/commons/serializers/unauthorized_spec.rb +46 -0
  51. data/spec/commons/serializers/unprocessable_entity_spec.rb +46 -0
  52. data/spec/commons/shared-examples/user_spec.rb +18 -0
  53. data/spec/dummy/.ruby-version +1 -0
  54. data/spec/dummy/Rakefile +6 -0
  55. data/spec/dummy/app/assets/config/manifest.js +2 -0
  56. data/spec/dummy/app/assets/images/.keep +0 -0
  57. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  58. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  59. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  60. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  61. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  62. data/spec/dummy/app/controllers/miscellaneous_controller.rb +13 -0
  63. data/spec/dummy/app/errors/default_handling.rb +35 -0
  64. data/spec/dummy/app/errors/error_notifier.rb +12 -0
  65. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  66. data/spec/dummy/app/javascript/packs/application.js +15 -0
  67. data/spec/dummy/app/jobs/application_job.rb +7 -0
  68. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  69. data/spec/dummy/app/models/application_record.rb +3 -0
  70. data/spec/dummy/app/models/catalogs/application_parameter.rb +6 -0
  71. data/spec/dummy/app/models/concerns/.keep +0 -0
  72. data/spec/dummy/app/models/employee.rb +3 -0
  73. data/spec/dummy/app/models/user.rb +16 -0
  74. data/spec/dummy/app/repositories/catalogs/application_parameter_repository.rb +4 -0
  75. data/spec/dummy/app/repositories/employee_repository.rb +2 -0
  76. data/spec/dummy/app/repositories/user_repository.rb +2 -0
  77. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  78. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  79. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  80. data/spec/dummy/bin/rails +4 -0
  81. data/spec/dummy/bin/rake +4 -0
  82. data/spec/dummy/bin/setup +33 -0
  83. data/spec/dummy/config.ru +5 -0
  84. data/spec/dummy/config/application.rb +29 -0
  85. data/spec/dummy/config/boot.rb +5 -0
  86. data/spec/dummy/config/cable.yml +10 -0
  87. data/spec/dummy/config/database.yml +25 -0
  88. data/spec/dummy/config/environment.rb +5 -0
  89. data/spec/dummy/config/environments/development.rb +62 -0
  90. data/spec/dummy/config/environments/production.rb +112 -0
  91. data/spec/dummy/config/environments/test.rb +48 -0
  92. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  93. data/spec/dummy/config/initializers/assets.rb +12 -0
  94. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  95. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  96. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  97. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  98. data/spec/dummy/config/initializers/inflections.rb +16 -0
  99. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  100. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  101. data/spec/dummy/config/locales/en.yml +33 -0
  102. data/spec/dummy/config/puma.rb +38 -0
  103. data/spec/dummy/config/routes.rb +9 -0
  104. data/spec/dummy/config/spring.rb +6 -0
  105. data/spec/dummy/config/storage.yml +34 -0
  106. data/spec/dummy/db/migrate/20191212233443_create_user.rb +13 -0
  107. data/spec/dummy/db/migrate/20191213072543_create_application_parameters.rb +8 -0
  108. data/spec/dummy/db/migrate/20200101204534_create_employee.rb +8 -0
  109. data/spec/dummy/db/schema.rb +35 -0
  110. data/spec/dummy/lib/assets/.keep +0 -0
  111. data/spec/dummy/log/.keep +0 -0
  112. data/spec/dummy/public/404.html +67 -0
  113. data/spec/dummy/public/422.html +67 -0
  114. data/spec/dummy/public/500.html +66 -0
  115. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  116. data/spec/dummy/public/apple-touch-icon.png +0 -0
  117. data/spec/dummy/public/favicon.ico +0 -0
  118. data/spec/factories/catalogs/application_parameters.rb +6 -0
  119. data/spec/factories/employees.rb +6 -0
  120. data/spec/factories/users.rb +7 -0
  121. data/spec/rails_helper.rb +68 -0
  122. data/spec/spec_helper.rb +108 -0
  123. data/spec/support/shared-examples/capitalizable.rb +16 -0
  124. data/spec/support/shared-examples/deletable.rb +39 -0
  125. data/spec/support/shared-examples/dimorphic.rb +28 -0
  126. data/spec/support/shared-examples/stripable.rb +17 -0
  127. data/spec/support/shared-examples/undestroyable.rb +8 -0
  128. metadata +249 -13
  129. data/lib/commons/concerns/extensions/deleted.rb +0 -25
@@ -0,0 +1,7 @@
1
+ FactoryBot.define do
2
+ factory :user, class: User do
3
+ name { Faker::Name.first_name }
4
+ last_name { Faker::Name.last_name }
5
+ sex { [Commons::Concerns::Attributes::Sex::FEMALE, Commons::Concerns::Attributes::Sex::MALE].sample }
6
+ end
7
+ end
@@ -0,0 +1,68 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ require 'spec_helper'
3
+ ENV['RAILS_ENV'] ||= 'test'
4
+
5
+ require File.expand_path('dummy/config/environment', __dir__)
6
+
7
+ # Prevent database truncation if the environment is production
8
+ abort("The Rails environment is running in production mode!") if Rails.env.production?
9
+ require 'rspec/rails'
10
+ # Add additional requires below this line. Rails is not loaded until this point!
11
+ require 'factory_bot_rails'
12
+ require 'faker'
13
+
14
+ Commons.secret_key_base = 'xxxxx'
15
+
16
+ # Requires supporting ruby files with custom matchers and macros, etc, in
17
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
18
+ # run as spec files by default. This means that files in spec/support that end
19
+ # in _spec.rb will both be required and run as specs, causing the specs to be
20
+ # run twice. It is recommended that you do not name files matching this glob to
21
+ # end with _spec.rb. You can configure this pattern with the --pattern
22
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
23
+ #
24
+ # The following line is provided for convenience purposes. It has the downside
25
+ # of increasing the boot-up time by auto-requiring all files in the support
26
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
27
+ # require only the support files necessary.
28
+ #
29
+ # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
30
+
31
+ # Checks for pending migrations and applies them before tests are run.
32
+ # If you are not using ActiveRecord, you can remove these lines.
33
+ begin
34
+ ActiveRecord::Migration.maintain_test_schema!
35
+ rescue ActiveRecord::PendingMigrationError => e
36
+ puts e.to_s.strip
37
+ exit 1
38
+ end
39
+ RSpec.configure do |config|
40
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
41
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
42
+ config.include FactoryBot::Syntax::Methods
43
+
44
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
45
+ # examples within a transaction, remove the following line or assign false
46
+ # instead of true.
47
+ config.use_transactional_fixtures = true
48
+
49
+ # RSpec Rails can automatically mix in different behaviours to your tests
50
+ # based on their file location, for example enabling you to call `get` and
51
+ # `post` in specs under `spec/controllers`.
52
+ #
53
+ # You can disable this behaviour by removing the line below, and instead
54
+ # explicitly tag your specs with their type, e.g.:
55
+ #
56
+ # RSpec.describe UsersController, :type => :controller do
57
+ # # ...
58
+ # end
59
+ #
60
+ # The different available types are documented in the features, such as in
61
+ # https://relishapp.com/rspec/rspec-rails/docs
62
+ config.infer_spec_type_from_file_location!
63
+
64
+ # Filter lines from Rails gems in backtraces.
65
+ config.filter_rails_from_backtrace!
66
+ # arbitrary gems may also be filtered via:
67
+ # config.filter_gems_from_backtrace("gem name")
68
+ end
@@ -0,0 +1,108 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
16
+ require 'simplecov'
17
+
18
+ SimpleCov.start
19
+
20
+ RSpec.configure do |config|
21
+ # rspec-expectations config goes here. You can use an alternate
22
+ # assertion/expectation library such as wrong or the stdlib/minitest
23
+ # assertions if you prefer.
24
+ config.expect_with :rspec do |expectations|
25
+ # This option will default to `true` in RSpec 4. It makes the `description`
26
+ # and `failure_message` of custom matchers include text for helper methods
27
+ # defined using `chain`, e.g.:
28
+ # be_bigger_than(2).and_smaller_than(4).description
29
+ # # => "be bigger than 2 and smaller than 4"
30
+ # ...rather than:
31
+ # # => "be bigger than 2"
32
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
33
+ end
34
+
35
+ # rspec-mocks config goes here. You can use an alternate test double
36
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
37
+ config.mock_with :rspec do |mocks|
38
+ # Prevents you from mocking or stubbing a method that does not exist on
39
+ # a real object. This is generally recommended, and will default to
40
+ # `true` in RSpec 4.
41
+ mocks.verify_partial_doubles = true
42
+ end
43
+
44
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
45
+ # have no way to turn it off -- the option exists only for backwards
46
+ # compatibility in RSpec 3). It causes shared context metadata to be
47
+ # inherited by the metadata hash of host groups and examples, rather than
48
+ # triggering implicit auto-inclusion in groups with matching metadata.
49
+ config.shared_context_metadata_behavior = :apply_to_host_groups
50
+
51
+ # This setting enables warnings. It's recommended, but in some cases may
52
+ # be too noisy due to issues in dependencies.
53
+ config.warnings = true
54
+
55
+ # The settings below are suggested to provide a good initial experience
56
+ # with RSpec, but feel free to customize to your heart's content.
57
+ =begin
58
+ # This allows you to limit a spec run to individual examples or groups
59
+ # you care about by tagging them with `:focus` metadata. When nothing
60
+ # is tagged with `:focus`, all examples get run. RSpec also provides
61
+ # aliases for `it`, `describe`, and `context` that include `:focus`
62
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
63
+ config.filter_run_when_matching :focus
64
+
65
+ # Allows RSpec to persist some state between runs in order to support
66
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
67
+ # you configure your source control system to ignore this file.
68
+ config.example_status_persistence_file_path = "spec/examples.txt"
69
+
70
+ # Limits the available syntax to the non-monkey patched syntax that is
71
+ # recommended. For more details, see:
72
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
73
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
74
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
75
+ config.disable_monkey_patching!
76
+
77
+ # This setting enables warnings. It's recommended, but in some cases may
78
+ # be too noisy due to issues in dependencies.
79
+ config.warnings = true
80
+
81
+ # Many RSpec users commonly either run the entire suite or an individual
82
+ # file, and it's useful to allow more verbose output when running an
83
+ # individual spec file.
84
+ if config.files_to_run.one?
85
+ # Use the documentation formatter for detailed output,
86
+ # unless a formatter has already been configured
87
+ # (e.g. via a command-line flag).
88
+ config.default_formatter = "doc"
89
+ end
90
+
91
+ # Print the 10 slowest examples and example groups at the
92
+ # end of the spec run, to help surface which specs are running
93
+ # particularly slow.
94
+ config.profile_examples = 10
95
+
96
+ # Run specs in random order to surface order dependencies. If you find an
97
+ # order dependency and want to debug it, you can fix the order by providing
98
+ # the seed, which is printed after each run.
99
+ # --seed 1234
100
+ config.order = :random
101
+
102
+ # Seed global randomization in this process using the `--seed` CLI option.
103
+ # Setting this allows you to use `--seed` to deterministically reproduce
104
+ # test failures related to randomization by passing the same `--seed` value
105
+ # as the one that triggered the failure.
106
+ Kernel.srand config.seed
107
+ =end
108
+ end
@@ -0,0 +1,16 @@
1
+ RSpec.shared_examples_for "capitalizable" do |attrs|
2
+ let(:model) { described_class }
3
+
4
+ it "is capitalizable" do
5
+ params = {}
6
+ attrs.each do |attr|
7
+ params[attr] = Faker::Name.last_name.downcase
8
+ end
9
+ obj = FactoryBot.build(model.to_s.underscore.to_sym, params)
10
+ obj.valid?
11
+ attrs.each do |attr|
12
+ value = obj.instance_eval(attr.to_s)
13
+ expect(value).to eq Commons::Formatter::StringUtils.capitalize(params[attr])
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,39 @@
1
+ RSpec.shared_examples_for "deletable" do |attrs|
2
+ let(:model) { described_class }
3
+
4
+ describe "works ok!" do
5
+ let(:obj) { FactoryBot.create(model.to_s.underscore.to_sym) }
6
+ subject do
7
+ obj
8
+ end
9
+
10
+ it "when model deleted" do
11
+ model = subject
12
+ model.deleted_at = Time.current
13
+ model.save
14
+ expect(model.deleted?).to be true
15
+ end
16
+
17
+ it "when model deleted do update" do
18
+ model = subject
19
+ model.deleted_at = Time.current
20
+ model.save
21
+ model.created_at = Time.current
22
+ expect{model.save}.to raise_error(ActiveRecord::RecordInvalid)
23
+ end
24
+
25
+ it "when model not deleted" do
26
+ model = subject
27
+ model.deleted_at = nil
28
+ model.save
29
+ expect(subject.deleted?).to be false
30
+ end
31
+
32
+ it "when model not deleted save" do
33
+ model = subject
34
+ model.deleted_at = nil
35
+ model.created_at = Time.current
36
+ expect{model.save}.not_to raise_error
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,28 @@
1
+ RSpec.shared_examples_for "dimorphic" do |attrs|
2
+ let(:model) { described_class }
3
+
4
+ describe "works ok!" do
5
+ let(:sex) { Commons::Concerns::Attributes::Sex::FEMALE }
6
+ let(:obj) { FactoryBot.build(model.to_s.underscore.to_sym) }
7
+ subject do
8
+ obj.sex = sex
9
+ obj
10
+ end
11
+
12
+ it "when value dimorphic" do
13
+ expect(subject.sex).to eq sex
14
+ expect(subject.female_sex?).to be true
15
+ end
16
+ end
17
+
18
+ describe "fails!" do
19
+ let(:obj) { FactoryBot.build(model.to_s.underscore.to_sym) }
20
+ subject do
21
+ obj.sex = 'random string'
22
+ end
23
+
24
+ it "when value not dimorphic" do
25
+ expect{ subject }.to raise_error(ArgumentError)
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,17 @@
1
+ RSpec.shared_examples_for "stripable" do |attrs|
2
+ let(:model) { described_class }
3
+ let(:dirty_string) { ' First Second ' }
4
+
5
+ it "is stripable" do
6
+ params = {}
7
+ attrs.each do |attr|
8
+ params[attr] = dirty_string
9
+ end
10
+ obj = FactoryBot.build(model.to_s.underscore.to_sym, params)
11
+ obj.update!(params)
12
+ attrs.each do |attr|
13
+ value = obj.instance_eval(attr.to_s)
14
+ expect(value).to eq params[attr].to_s.strip.squeeze(" ")
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,8 @@
1
+ RSpec.shared_examples_for "undestroyable" do
2
+ let(:model) { described_class }
3
+
4
+ it "is undestroyable" do
5
+ obj = FactoryBot.build(model.to_s.underscore.to_sym)
6
+ expect { obj.destroy }.to raise_error Commons::Errors::Unauthorized
7
+ end
8
+ end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commons_yellowme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yellowme
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2019-12-10 00:00:00.000000000 Z
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.1
19
+ version: '6.0'
20
20
  type: :runtime
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: 6.0.1
26
+ version: '6.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.8'
33
+ version: '2.0'
34
34
  type: :runtime
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: '1.8'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: active_model_serializers
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -180,18 +180,25 @@ dependencies:
180
180
  version: '0'
181
181
  description: Commons is Yellowme's Rails APIs utilities gem
182
182
  email: hola@yellowme.mx
183
- executables: []
183
+ executables:
184
+ - test
184
185
  extensions: []
185
186
  extra_rdoc_files: []
186
187
  files:
188
+ - ".gitignore"
189
+ - ".rspec"
190
+ - Gemfile
191
+ - Gemfile.lock
187
192
  - MIT-LICENSE
188
193
  - README.md
189
194
  - Rakefile
195
+ - bin/test
196
+ - commons.gemspec
190
197
  - lib/commons.rb
191
198
  - lib/commons/authentication/authenticate_by_jwt.rb
192
199
  - lib/commons/authentication/json_web_token.rb
193
200
  - lib/commons/concerns/attributes/sex.rb
194
- - lib/commons/concerns/extensions/deleted.rb
201
+ - lib/commons/concerns/extensions/soft_deleted.rb
195
202
  - lib/commons/concerns/guard/capitalizable.rb
196
203
  - lib/commons/concerns/validations/undestroyable.rb
197
204
  - lib/commons/config.rb
@@ -227,11 +234,126 @@ files:
227
234
  - lib/commons/services/concerns/callable.rb
228
235
  - lib/commons/version.rb
229
236
  - lib/tasks/commons_tasks.rake
237
+ - spec/commons/authentication/authenticate_by_jwt_spec.rb
238
+ - spec/commons/authentication/json_web_token_spec.rb
239
+ - spec/commons/concerns/attributes/sex_spec.rb
240
+ - spec/commons/concerns/extensions/deleted_spec.rb
241
+ - spec/commons/concerns/guard/capitalizable_spec.rb
242
+ - spec/commons/concerns/validations/undestroyable_spec.rb
243
+ - spec/commons/errors/bad_request_spec.rb
244
+ - spec/commons/errors/conflict_spec.rb
245
+ - spec/commons/errors/forbidden_spec.rb
246
+ - spec/commons/errors/internal_server_error_spec.rb
247
+ - spec/commons/errors/invalid_resource_spec.rb
248
+ - spec/commons/errors/maintenance_mode_spec.rb
249
+ - spec/commons/errors/missing_parameter_spec.rb
250
+ - spec/commons/errors/not_unique_spec.rb
251
+ - spec/commons/errors/payment_required_spec.rb
252
+ - spec/commons/errors/precondition_failed_spec.rb
253
+ - spec/commons/errors/resource_not_found_spec.rb
254
+ - spec/commons/errors/route_not_found_spec.rb
255
+ - spec/commons/errors/unauthorized_spec.rb
256
+ - spec/commons/errors/unprocessable_entity_spec.rb
257
+ - spec/commons/formatter/e164_phone_spec.rb
258
+ - spec/commons/formatter/regex_constants_spec.rb
259
+ - spec/commons/formatter/string_utils_spec.rb
260
+ - spec/commons/repositories/base_repository_spec.rb
261
+ - spec/commons/repositories/catalogs/base_catalog_spec.rb
262
+ - spec/commons/serializers/bad_request_spec.rb
263
+ - spec/commons/serializers/conflict_spec.rb
264
+ - spec/commons/serializers/forbidden_spec.rb
265
+ - spec/commons/serializers/internal_server_error_spec.rb
266
+ - spec/commons/serializers/invalid_resource_spec.rb
267
+ - spec/commons/serializers/maintenance_mode_spec.rb
268
+ - spec/commons/serializers/missing_parameter_spec.rb
269
+ - spec/commons/serializers/not_unique_spec.rb
270
+ - spec/commons/serializers/payment_required_spec.rb
271
+ - spec/commons/serializers/precondition_failed_spec.rb
272
+ - spec/commons/serializers/route_not_found_spec.rb
273
+ - spec/commons/serializers/unauthorized_spec.rb
274
+ - spec/commons/serializers/unprocessable_entity_spec.rb
275
+ - spec/commons/shared-examples/user_spec.rb
276
+ - spec/dummy/.ruby-version
277
+ - spec/dummy/Rakefile
278
+ - spec/dummy/app/assets/config/manifest.js
279
+ - spec/dummy/app/assets/images/.keep
280
+ - spec/dummy/app/assets/stylesheets/application.css
281
+ - spec/dummy/app/channels/application_cable/channel.rb
282
+ - spec/dummy/app/channels/application_cable/connection.rb
283
+ - spec/dummy/app/controllers/application_controller.rb
284
+ - spec/dummy/app/controllers/concerns/.keep
285
+ - spec/dummy/app/controllers/miscellaneous_controller.rb
286
+ - spec/dummy/app/errors/default_handling.rb
287
+ - spec/dummy/app/errors/error_notifier.rb
288
+ - spec/dummy/app/helpers/application_helper.rb
289
+ - spec/dummy/app/javascript/packs/application.js
290
+ - spec/dummy/app/jobs/application_job.rb
291
+ - spec/dummy/app/mailers/application_mailer.rb
292
+ - spec/dummy/app/models/application_record.rb
293
+ - spec/dummy/app/models/catalogs/application_parameter.rb
294
+ - spec/dummy/app/models/concerns/.keep
295
+ - spec/dummy/app/models/employee.rb
296
+ - spec/dummy/app/models/user.rb
297
+ - spec/dummy/app/repositories/catalogs/application_parameter_repository.rb
298
+ - spec/dummy/app/repositories/employee_repository.rb
299
+ - spec/dummy/app/repositories/user_repository.rb
300
+ - spec/dummy/app/views/layouts/application.html.erb
301
+ - spec/dummy/app/views/layouts/mailer.html.erb
302
+ - spec/dummy/app/views/layouts/mailer.text.erb
303
+ - spec/dummy/bin/rails
304
+ - spec/dummy/bin/rake
305
+ - spec/dummy/bin/setup
306
+ - spec/dummy/config.ru
307
+ - spec/dummy/config/application.rb
308
+ - spec/dummy/config/boot.rb
309
+ - spec/dummy/config/cable.yml
310
+ - spec/dummy/config/database.yml
311
+ - spec/dummy/config/environment.rb
312
+ - spec/dummy/config/environments/development.rb
313
+ - spec/dummy/config/environments/production.rb
314
+ - spec/dummy/config/environments/test.rb
315
+ - spec/dummy/config/initializers/application_controller_renderer.rb
316
+ - spec/dummy/config/initializers/assets.rb
317
+ - spec/dummy/config/initializers/backtrace_silencers.rb
318
+ - spec/dummy/config/initializers/content_security_policy.rb
319
+ - spec/dummy/config/initializers/cookies_serializer.rb
320
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
321
+ - spec/dummy/config/initializers/inflections.rb
322
+ - spec/dummy/config/initializers/mime_types.rb
323
+ - spec/dummy/config/initializers/wrap_parameters.rb
324
+ - spec/dummy/config/locales/en.yml
325
+ - spec/dummy/config/puma.rb
326
+ - spec/dummy/config/routes.rb
327
+ - spec/dummy/config/spring.rb
328
+ - spec/dummy/config/storage.yml
329
+ - spec/dummy/db/migrate/20191212233443_create_user.rb
330
+ - spec/dummy/db/migrate/20191213072543_create_application_parameters.rb
331
+ - spec/dummy/db/migrate/20200101204534_create_employee.rb
332
+ - spec/dummy/db/schema.rb
333
+ - spec/dummy/lib/assets/.keep
334
+ - spec/dummy/log/.keep
335
+ - spec/dummy/public/404.html
336
+ - spec/dummy/public/422.html
337
+ - spec/dummy/public/500.html
338
+ - spec/dummy/public/apple-touch-icon-precomposed.png
339
+ - spec/dummy/public/apple-touch-icon.png
340
+ - spec/dummy/public/favicon.ico
341
+ - spec/factories/catalogs/application_parameters.rb
342
+ - spec/factories/employees.rb
343
+ - spec/factories/users.rb
344
+ - spec/rails_helper.rb
345
+ - spec/spec_helper.rb
346
+ - spec/support/.DS_Store
347
+ - spec/support/shared-examples/capitalizable.rb
348
+ - spec/support/shared-examples/deletable.rb
349
+ - spec/support/shared-examples/dimorphic.rb
350
+ - spec/support/shared-examples/stripable.rb
351
+ - spec/support/shared-examples/undestroyable.rb
230
352
  homepage: https://github.com/yellowme/commons-rails
231
353
  licenses:
232
354
  - MIT
233
355
  metadata: {}
234
- post_install_message:
356
+ post_install_message:
235
357
  rdoc_options: []
236
358
  require_paths:
237
359
  - lib
@@ -246,9 +368,123 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
368
  - !ruby/object:Gem::Version
247
369
  version: '0'
248
370
  requirements: []
249
- rubyforge_project:
250
- rubygems_version: 2.7.6
251
- signing_key:
371
+ rubygems_version: 3.1.2
372
+ signing_key:
252
373
  specification_version: 4
253
374
  summary: Commons is Yellowme's Rails APIs utilities gem
254
- test_files: []
375
+ test_files:
376
+ - spec/commons/authentication/authenticate_by_jwt_spec.rb
377
+ - spec/commons/authentication/json_web_token_spec.rb
378
+ - spec/commons/concerns/attributes/sex_spec.rb
379
+ - spec/commons/concerns/extensions/deleted_spec.rb
380
+ - spec/commons/concerns/guard/capitalizable_spec.rb
381
+ - spec/commons/concerns/validations/undestroyable_spec.rb
382
+ - spec/commons/errors/bad_request_spec.rb
383
+ - spec/commons/errors/conflict_spec.rb
384
+ - spec/commons/errors/forbidden_spec.rb
385
+ - spec/commons/errors/internal_server_error_spec.rb
386
+ - spec/commons/errors/invalid_resource_spec.rb
387
+ - spec/commons/errors/maintenance_mode_spec.rb
388
+ - spec/commons/errors/missing_parameter_spec.rb
389
+ - spec/commons/errors/not_unique_spec.rb
390
+ - spec/commons/errors/payment_required_spec.rb
391
+ - spec/commons/errors/precondition_failed_spec.rb
392
+ - spec/commons/errors/resource_not_found_spec.rb
393
+ - spec/commons/errors/route_not_found_spec.rb
394
+ - spec/commons/errors/unauthorized_spec.rb
395
+ - spec/commons/errors/unprocessable_entity_spec.rb
396
+ - spec/commons/formatter/e164_phone_spec.rb
397
+ - spec/commons/formatter/regex_constants_spec.rb
398
+ - spec/commons/formatter/string_utils_spec.rb
399
+ - spec/commons/repositories/base_repository_spec.rb
400
+ - spec/commons/repositories/catalogs/base_catalog_spec.rb
401
+ - spec/commons/serializers/bad_request_spec.rb
402
+ - spec/commons/serializers/conflict_spec.rb
403
+ - spec/commons/serializers/forbidden_spec.rb
404
+ - spec/commons/serializers/internal_server_error_spec.rb
405
+ - spec/commons/serializers/invalid_resource_spec.rb
406
+ - spec/commons/serializers/maintenance_mode_spec.rb
407
+ - spec/commons/serializers/missing_parameter_spec.rb
408
+ - spec/commons/serializers/not_unique_spec.rb
409
+ - spec/commons/serializers/payment_required_spec.rb
410
+ - spec/commons/serializers/precondition_failed_spec.rb
411
+ - spec/commons/serializers/route_not_found_spec.rb
412
+ - spec/commons/serializers/unauthorized_spec.rb
413
+ - spec/commons/serializers/unprocessable_entity_spec.rb
414
+ - spec/commons/shared-examples/user_spec.rb
415
+ - spec/dummy/.ruby-version
416
+ - spec/dummy/Rakefile
417
+ - spec/dummy/app/assets/config/manifest.js
418
+ - spec/dummy/app/assets/images/.keep
419
+ - spec/dummy/app/assets/stylesheets/application.css
420
+ - spec/dummy/app/channels/application_cable/channel.rb
421
+ - spec/dummy/app/channels/application_cable/connection.rb
422
+ - spec/dummy/app/controllers/application_controller.rb
423
+ - spec/dummy/app/controllers/concerns/.keep
424
+ - spec/dummy/app/controllers/miscellaneous_controller.rb
425
+ - spec/dummy/app/errors/default_handling.rb
426
+ - spec/dummy/app/errors/error_notifier.rb
427
+ - spec/dummy/app/helpers/application_helper.rb
428
+ - spec/dummy/app/javascript/packs/application.js
429
+ - spec/dummy/app/jobs/application_job.rb
430
+ - spec/dummy/app/mailers/application_mailer.rb
431
+ - spec/dummy/app/models/application_record.rb
432
+ - spec/dummy/app/models/catalogs/application_parameter.rb
433
+ - spec/dummy/app/models/concerns/.keep
434
+ - spec/dummy/app/models/employee.rb
435
+ - spec/dummy/app/models/user.rb
436
+ - spec/dummy/app/repositories/catalogs/application_parameter_repository.rb
437
+ - spec/dummy/app/repositories/employee_repository.rb
438
+ - spec/dummy/app/repositories/user_repository.rb
439
+ - spec/dummy/app/views/layouts/application.html.erb
440
+ - spec/dummy/app/views/layouts/mailer.html.erb
441
+ - spec/dummy/app/views/layouts/mailer.text.erb
442
+ - spec/dummy/bin/rails
443
+ - spec/dummy/bin/rake
444
+ - spec/dummy/bin/setup
445
+ - spec/dummy/config.ru
446
+ - spec/dummy/config/application.rb
447
+ - spec/dummy/config/boot.rb
448
+ - spec/dummy/config/cable.yml
449
+ - spec/dummy/config/database.yml
450
+ - spec/dummy/config/environment.rb
451
+ - spec/dummy/config/environments/development.rb
452
+ - spec/dummy/config/environments/production.rb
453
+ - spec/dummy/config/environments/test.rb
454
+ - spec/dummy/config/initializers/application_controller_renderer.rb
455
+ - spec/dummy/config/initializers/assets.rb
456
+ - spec/dummy/config/initializers/backtrace_silencers.rb
457
+ - spec/dummy/config/initializers/content_security_policy.rb
458
+ - spec/dummy/config/initializers/cookies_serializer.rb
459
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
460
+ - spec/dummy/config/initializers/inflections.rb
461
+ - spec/dummy/config/initializers/mime_types.rb
462
+ - spec/dummy/config/initializers/wrap_parameters.rb
463
+ - spec/dummy/config/locales/en.yml
464
+ - spec/dummy/config/puma.rb
465
+ - spec/dummy/config/routes.rb
466
+ - spec/dummy/config/spring.rb
467
+ - spec/dummy/config/storage.yml
468
+ - spec/dummy/db/migrate/20191212233443_create_user.rb
469
+ - spec/dummy/db/migrate/20191213072543_create_application_parameters.rb
470
+ - spec/dummy/db/migrate/20200101204534_create_employee.rb
471
+ - spec/dummy/db/schema.rb
472
+ - spec/dummy/lib/assets/.keep
473
+ - spec/dummy/log/.keep
474
+ - spec/dummy/public/404.html
475
+ - spec/dummy/public/422.html
476
+ - spec/dummy/public/500.html
477
+ - spec/dummy/public/apple-touch-icon-precomposed.png
478
+ - spec/dummy/public/apple-touch-icon.png
479
+ - spec/dummy/public/favicon.ico
480
+ - spec/factories/catalogs/application_parameters.rb
481
+ - spec/factories/employees.rb
482
+ - spec/factories/users.rb
483
+ - spec/rails_helper.rb
484
+ - spec/spec_helper.rb
485
+ - spec/support/.DS_Store
486
+ - spec/support/shared-examples/capitalizable.rb
487
+ - spec/support/shared-examples/deletable.rb
488
+ - spec/support/shared-examples/dimorphic.rb
489
+ - spec/support/shared-examples/stripable.rb
490
+ - spec/support/shared-examples/undestroyable.rb