Sha256: 4da94e2c7df6e96bf65584f2e88d9c40ac44cf0543861d436117df334eb25d5a

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

# Warnings Logger

Easily log warnings in your gems.

## Installation

Add this line to your gem's gemspec:

```ruby
spec.add_development_dependency('warnings_logger')
```

If you have a Gemfile, run:

``` bash
bundle install
```

Or, install the gem yourself:

``` bash
gem install warnings_logger
```

## Usage

To use this gem, place the following in `spec/spec_helper.rb` or
`test/test_helper.rb`, replacing `<project name>` with the name of the gem
you're developing:

``` ruby
WarningsLogger::Spy.call(
  project_name: '<project name>',
  project_directory: Pathname.new('../..').expand_path(__FILE__),
)
```

We also recommend you run your tests by enabling warnings in general. For RSpec
this means updating the RSpec::Core::RakeTask by setting `config.warnings =
true` and setting `$VERBOSE = true` in your spec helper. For Minitest, this
means updating your Rake::Task::TestTask by setting `t.verbose = true` and
setting `$VERBOSE = true` in your test helper.

With the above code in place, now when you run your tests, if your gem emits any
warnings, they will be written to a file (which is printed to your terminal) and
the exit code of the test run will be 1. This helps you ensure that your gem is
warning-free before you release a new version.

## Developing

* `bin/setup` to get started
* `bundle exec rake release` to release a new version

## Author/License

Snowglobe is © 2019 Elliot Winkler (<elliot.winkler@gmail.com>) and is released
under the [MIT license](LICENSE).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
warnings_logger-0.1.0 README.md