a_r_q_logger 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +53 -102
  3. data/README.md +75 -0
  4. data/a_r_q_logger.gemspec +3 -3
  5. data/lib/a_r_q_logger.rb +14 -5
  6. data/lib/a_r_q_logger/initializer.rb +4 -0
  7. data/lib/a_r_q_logger/version.rb +1 -1
  8. data/spec/{dummy/app/models → models}/test_child_model.rb +0 -0
  9. data/spec/{dummy/app/models → models}/test_model.rb +0 -0
  10. data/spec/supports/schema.rb +56 -0
  11. data/spec/test_model_spec.rb +73 -0
  12. metadata +26 -68
  13. data/spec/dummy/README.rdoc +0 -28
  14. data/spec/dummy/Rakefile +0 -6
  15. data/spec/dummy/app/assets/images/.keep +0 -0
  16. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  17. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  18. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  19. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  20. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  21. data/spec/dummy/app/mailers/.keep +0 -0
  22. data/spec/dummy/app/models/.keep +0 -0
  23. data/spec/dummy/app/models/concerns/.keep +0 -0
  24. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  25. data/spec/dummy/bin/bundle +0 -3
  26. data/spec/dummy/bin/rails +0 -4
  27. data/spec/dummy/bin/rake +0 -4
  28. data/spec/dummy/config.ru +0 -4
  29. data/spec/dummy/config/application.rb +0 -35
  30. data/spec/dummy/config/boot.rb +0 -5
  31. data/spec/dummy/config/database.def.yml +0 -25
  32. data/spec/dummy/config/environment.rb +0 -5
  33. data/spec/dummy/config/environments/development.rb +0 -29
  34. data/spec/dummy/config/environments/production.rb +0 -80
  35. data/spec/dummy/config/environments/test.rb +0 -36
  36. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  37. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  38. data/spec/dummy/config/initializers/inflections.rb +0 -16
  39. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  40. data/spec/dummy/config/initializers/secret_token.rb +0 -12
  41. data/spec/dummy/config/initializers/session_store.rb +0 -3
  42. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  43. data/spec/dummy/config/locales/en.yml +0 -23
  44. data/spec/dummy/config/routes.rb +0 -56
  45. data/spec/dummy/db/migrate/20161016035357_create_test_models.rb +0 -9
  46. data/spec/dummy/db/migrate/20161016035434_create_test_child_models.rb +0 -10
  47. data/spec/dummy/db/schema.rb +0 -28
  48. data/spec/dummy/lib/assets/.keep +0 -0
  49. data/spec/dummy/log/.keep +0 -0
  50. data/spec/dummy/public/404.html +0 -58
  51. data/spec/dummy/public/422.html +0 -58
  52. data/spec/dummy/public/500.html +0 -57
  53. data/spec/dummy/public/favicon.ico +0 -0
  54. data/spec/dummy/spec/models/test_model_spec.rb +0 -45
  55. data/spec/rails_helper.rb +0 -67
  56. data/spec/spec_helper.rb +0 -101
@@ -1,57 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style>
6
- body {
7
- background-color: #EFEFEF;
8
- color: #2E2F30;
9
- text-align: center;
10
- font-family: arial, sans-serif;
11
- }
12
-
13
- div.dialog {
14
- width: 25em;
15
- margin: 4em auto 0 auto;
16
- border: 1px solid #CCC;
17
- border-right-color: #999;
18
- border-left-color: #999;
19
- border-bottom-color: #BBB;
20
- border-top: #B00100 solid 4px;
21
- border-top-left-radius: 9px;
22
- border-top-right-radius: 9px;
23
- background-color: white;
24
- padding: 7px 4em 0 4em;
25
- }
26
-
27
- h1 {
28
- font-size: 100%;
29
- color: #730E15;
30
- line-height: 1.5em;
31
- }
32
-
33
- body > p {
34
- width: 33em;
35
- margin: 0 auto 1em;
36
- padding: 1em 0;
37
- background-color: #F7F7F7;
38
- border: 1px solid #CCC;
39
- border-right-color: #999;
40
- border-bottom-color: #999;
41
- border-bottom-left-radius: 4px;
42
- border-bottom-right-radius: 4px;
43
- border-top-color: #DADADA;
44
- color: #666;
45
- box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
- }
47
- </style>
48
- </head>
49
-
50
- <body>
51
- <!-- This file lives in public/500.html -->
52
- <div class="dialog">
53
- <h1>We're sorry, but something went wrong.</h1>
54
- </div>
55
- <p>If you are the application owner check the logs for more information.</p>
56
- </body>
57
- </html>
File without changes
@@ -1,45 +0,0 @@
1
- require 'rails_helper'
2
- require 'a_r_q_logger'
3
-
4
- RSpec.describe TestModel, type: :model do
5
- it do
6
- TestModel.create!
7
- end
8
-
9
- it do
10
- expect(ARQLogger.log {
11
- TestModel.create!
12
- }.count).to eq(1)
13
- end
14
-
15
- it do
16
- expect(ARQLogger.log {
17
- TestModel.create!
18
- TestModel.create!
19
- }.count).to eq(2)
20
- end
21
-
22
- context 'with associations' do
23
- before :all do
24
- 10.times {
25
- TestChildModel.create!(test_model: TestModel.create!, name: SecureRandom.hex(4))
26
- }
27
- end
28
-
29
- after :all do
30
- TestModel.destroy_all
31
- end
32
-
33
- it do
34
- expect(ARQLogger.log {
35
- TestModel.includes(:test_child_models).all.each { |m| m.test_child_models.map(&:name) }
36
- }.count).to eq(2)
37
- end
38
-
39
- it do
40
- expect(ARQLogger.log {
41
- TestModel.all.each { |m| m.test_child_models.map(&:name) }
42
- }.count).to eq(11)
43
- end
44
- end
45
- end
data/spec/rails_helper.rb DELETED
@@ -1,67 +0,0 @@
1
- # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- ENV['RAILS_ENV'] ||= 'test'
3
- require File.expand_path('../dummy/config/environment', __FILE__)
4
- # Prevent database truncation if the environment is production
5
- abort("The Rails environment is running in production mode!") if Rails.env.production?
6
- require 'spec_helper'
7
- require 'rspec/rails'
8
- require 'factory_girl_rails'
9
- require 'rspec-html-matchers'
10
-
11
- # Add additional requires below this line. Rails is not loaded until this point!
12
-
13
- # Requires supporting ruby files with custom matchers and macros, etc, in
14
- # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
15
- # run as spec files by default. This means that files in spec/support that end
16
- # in _spec.rb will both be required and run as specs, causing the specs to be
17
- # run twice. It is recommended that you do not name files matching this glob to
18
- # end with _spec.rb. You can configure this pattern with the --pattern
19
- # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
20
- #
21
- # The following line is provided for convenience purposes. It has the downside
22
- # of increasing the boot-up time by auto-requiring all files in the support
23
- # directory. Alternatively, in the individual `*_spec.rb` files, manually
24
- # require only the support files necessary.
25
- #
26
- # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
27
-
28
- # Checks for pending migration and applies them before tests are run.
29
- # If you are not using ActiveRecord, you can remove this line.
30
- ActiveRecord::Migration.maintain_test_schema!
31
-
32
- RSpec.configure do |config|
33
- config.include RSpecHtmlMatchers
34
- config.include FactoryGirl::Syntax::Methods
35
-
36
- config.before(:all) do
37
- FactoryGirl.reload
38
- end
39
-
40
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
41
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
42
-
43
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
44
- # examples within a transaction, remove the following line or assign false
45
- # instead of true.
46
- config.use_transactional_fixtures = true
47
-
48
- # RSpec Rails can automatically mix in different behaviours to your tests
49
- # based on their file location, for example enabling you to call `get` and
50
- # `post` in specs under `spec/controllers`.
51
- #
52
- # You can disable this behaviour by removing the line below, and instead
53
- # explicitly tag your specs with their type, e.g.:
54
- #
55
- # RSpec.describe UsersController, :type => :controller do
56
- # # ...
57
- # end
58
- #
59
- # The different available types are documented in the features, such as in
60
- # https://relishapp.com/rspec/rspec-rails/docs
61
- config.infer_spec_type_from_file_location!
62
-
63
- # Filter lines from Rails gems in backtraces.
64
- config.filter_rails_from_backtrace!
65
- # arbitrary gems may also be filtered via:
66
- # config.filter_gems_from_backtrace("gem name")
67
- end
data/spec/spec_helper.rb DELETED
@@ -1,101 +0,0 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
- # This file was generated by the `rails generate rspec:install` command. Conventionally, all
4
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
- # The generated `.rspec` file contains `--require spec_helper` which will cause
6
- # this file to always be loaded, without a need to explicitly require it in any
7
- # files.
8
- #
9
- # Given that it is always loaded, you are encouraged to keep this file as
10
- # light-weight as possible. Requiring heavyweight dependencies from this file
11
- # will add to the boot time of your test suite on EVERY test run, even for an
12
- # individual file that may not need all of that loaded. Instead, consider making
13
- # a separate helper file that requires the additional dependencies and performs
14
- # the additional setup, and require it from the spec files that actually need
15
- # it.
16
- #
17
- # The `.rspec` file also contains a few flags that are not defaults but that
18
- # users commonly want.
19
- #
20
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
21
- RSpec.configure do |config|
22
- # rspec-expectations config goes here. You can use an alternate
23
- # assertion/expectation library such as wrong or the stdlib/minitest
24
- # assertions if you prefer.
25
- config.expect_with :rspec do |expectations|
26
- # This option will default to `true` in RSpec 4. It makes the `description`
27
- # and `failure_message` of custom matchers include text for helper methods
28
- # defined using `chain`, e.g.:
29
- # be_bigger_than(2).and_smaller_than(4).description
30
- # # => "be bigger than 2 and smaller than 4"
31
- # ...rather than:
32
- # # => "be bigger than 2"
33
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
34
- end
35
-
36
- # rspec-mocks config goes here. You can use an alternate test double
37
- # library (such as bogus or mocha) by changing the `mock_with` option here.
38
- config.mock_with :rspec do |mocks|
39
- # Prevents you from mocking or stubbing a method that does not exist on
40
- # a real object. This is generally recommended, and will default to
41
- # `true` in RSpec 4.
42
- mocks.verify_partial_doubles = true
43
- end
44
-
45
- # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
46
- # have no way to turn it off -- the option exists only for backwards
47
- # compatibility in RSpec 3). It causes shared context metadata to be
48
- # inherited by the metadata hash of host groups and examples, rather than
49
- # triggering implicit auto-inclusion in groups with matching metadata.
50
- config.shared_context_metadata_behavior = :apply_to_host_groups
51
-
52
- # The settings below are suggested to provide a good initial experience
53
- # with RSpec, but feel free to customize to your heart's content.
54
- =begin
55
- # This allows you to limit a spec run to individual examples or groups
56
- # you care about by tagging them with `:focus` metadata. When nothing
57
- # is tagged with `:focus`, all examples get run. RSpec also provides
58
- # aliases for `it`, `describe`, and `context` that include `:focus`
59
- # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
60
- config.filter_run_when_matching :focus
61
-
62
- # Allows RSpec to persist some state between runs in order to support
63
- # the `--only-failures` and `--next-failure` CLI options. We recommend
64
- # you configure your source control system to ignore this file.
65
- config.example_status_persistence_file_path = "spec/examples.txt"
66
-
67
- # Limits the available syntax to the non-monkey patched syntax that is
68
- # recommended. For more details, see:
69
- # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
70
- # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
71
- # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
72
- config.disable_monkey_patching!
73
-
74
- # Many RSpec users commonly either run the entire suite or an individual
75
- # file, and it's useful to allow more verbose output when running an
76
- # individual spec file.
77
- if config.files_to_run.one?
78
- # Use the documentation formatter for detailed output,
79
- # unless a formatter has already been configured
80
- # (e.g. via a command-line flag).
81
- config.default_formatter = 'doc'
82
- end
83
-
84
- # Print the 10 slowest examples and example groups at the
85
- # end of the spec run, to help surface which specs are running
86
- # particularly slow.
87
- config.profile_examples = 10
88
-
89
- # Run specs in random order to surface order dependencies. If you find an
90
- # order dependency and want to debug it, you can fix the order by providing
91
- # the seed, which is printed after each run.
92
- # --seed 1234
93
- config.order = :random
94
-
95
- # Seed global randomization in this process using the `--seed` CLI option.
96
- # Setting this allows you to use `--seed` to deterministically reproduce
97
- # test failures related to randomization by passing the same `--seed` value
98
- # as the one that triggered the failure.
99
- Kernel.srand config.seed
100
- =end
101
- end