warnings_logger 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -3
- data/.rubocop.yml +50 -20
- data/Gemfile +8 -0
- data/LICENSE +1 -1
- data/README.md +11 -11
- data/Rakefile +5 -0
- data/lib/warnings_logger.rb +26 -6
- data/lib/warnings_logger/configuration.rb +48 -4
- data/lib/warnings_logger/filesystem.rb +6 -6
- data/lib/warnings_logger/reporter.rb +24 -17
- data/lib/warnings_logger/spy.rb +70 -19
- data/lib/warnings_logger/version.rb +1 -1
- data/warnings_logger.gemspec +0 -4
- metadata +8 -53
- data/.rspec +0 -3
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 529052ada7a035ccb7a33a4cd72242645341d81fa40b2d6b6f68557f956e26bc
|
4
|
+
data.tar.gz: d6f27ae8d65273e4de47830c604f2074e225fa615ecdf2e4306b31297c750e6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2573cad3bcc255ba50262f721a110450f6884115fb11029a6752805df94d1302facb7156d6385195fa8f7eac516573e67838a3e690bac7deae5a84d8c2d2574e
|
7
|
+
data.tar.gz: 0a4df5f4bf66b422c4793d96ee2f55baf0c00f4e20026e5c6d64c192689ef449b89b681557cd7e3bdaa7c6f736a821a6a13c9da484e57f57aff4fe82e596d526
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -2,20 +2,23 @@
|
|
2
2
|
AllCops:
|
3
3
|
Exclude:
|
4
4
|
- db/schema.rb
|
5
|
+
NewCops: enable
|
5
6
|
TargetRubyVersion: 2.5
|
6
|
-
Layout/
|
7
|
+
Layout/ParameterAlignment:
|
7
8
|
EnforcedStyle: with_fixed_indentation
|
8
9
|
Layout/ClassStructure:
|
9
10
|
Enabled: true
|
11
|
+
Layout/CommentIndentation:
|
12
|
+
Enabled: false
|
10
13
|
Layout/DotPosition:
|
11
|
-
EnforcedStyle:
|
14
|
+
EnforcedStyle: leading
|
12
15
|
Layout/InitialIndentation:
|
13
16
|
Enabled: false
|
14
|
-
Layout/
|
15
|
-
EnforcedStyle:
|
16
|
-
Layout/
|
17
|
-
EnforcedStyle:
|
18
|
-
Layout/
|
17
|
+
Layout/FirstArrayElementIndentation:
|
18
|
+
EnforcedStyle: consistent
|
19
|
+
Layout/FirstHashElementIndentation:
|
20
|
+
EnforcedStyle: consistent
|
21
|
+
Layout/HeredocIndentation:
|
19
22
|
Enabled: false
|
20
23
|
Layout/MultilineOperationIndentation:
|
21
24
|
EnforcedStyle: indented
|
@@ -23,11 +26,13 @@ Layout/MultilineMethodCallIndentation:
|
|
23
26
|
EnforcedStyle: indented
|
24
27
|
Layout/SpaceInLambdaLiteral:
|
25
28
|
Enabled: false
|
29
|
+
Layout/SpaceInsideRangeLiteral:
|
30
|
+
Enabled: false
|
26
31
|
Layout/SpaceInsideStringInterpolation:
|
27
32
|
Enabled: false
|
28
33
|
Lint/AssignmentInCondition:
|
29
34
|
Enabled: false
|
30
|
-
Lint/
|
35
|
+
Lint/SuppressedException:
|
31
36
|
Enabled: false
|
32
37
|
Lint/RequireParentheses:
|
33
38
|
Enabled: false
|
@@ -35,17 +40,24 @@ Metrics/AbcSize:
|
|
35
40
|
Max: 32
|
36
41
|
Metrics/BlockLength:
|
37
42
|
ExcludedMethods:
|
38
|
-
- describe
|
39
43
|
- context
|
44
|
+
- define
|
45
|
+
- describe
|
40
46
|
- it
|
41
|
-
-
|
47
|
+
- shared_context
|
48
|
+
- shared_examples
|
49
|
+
- shared_examples_for
|
42
50
|
Metrics/ClassLength:
|
43
51
|
Enabled: false
|
44
|
-
Metrics/
|
52
|
+
Metrics/CyclomaticComplexity:
|
53
|
+
Max: 15
|
54
|
+
Layout/LineLength:
|
45
55
|
Max: 80
|
46
56
|
IgnoredPatterns:
|
47
|
-
- "^\\s*describe"
|
57
|
+
- "^\\s*RSpec.describe"
|
58
|
+
- "^\\s*class [\\w:]+ < [\\w:]+"
|
48
59
|
- "^\\s*context"
|
60
|
+
- "^\\s*describe"
|
49
61
|
- "^\\s*it"
|
50
62
|
Metrics/MethodLength:
|
51
63
|
Enabled: false
|
@@ -53,25 +65,39 @@ Metrics/ModuleLength:
|
|
53
65
|
Enabled: false
|
54
66
|
Metrics/ParameterLists:
|
55
67
|
CountKeywordArgs: false
|
68
|
+
Metrics/PerceivedComplexity:
|
69
|
+
Max: 15
|
70
|
+
Naming/AccessorMethodName:
|
71
|
+
Enabled: false
|
72
|
+
Naming/BinaryOperatorParameterName:
|
73
|
+
Enabled: false
|
56
74
|
Naming/MemoizedInstanceVariableName:
|
57
75
|
EnforcedStyleForLeadingUnderscores: required
|
58
76
|
Naming/PredicateName:
|
59
|
-
|
77
|
+
ForbiddenPrefixes:
|
60
78
|
- is_
|
61
79
|
Exclude:
|
62
80
|
- spec/**/*
|
63
|
-
Naming/
|
81
|
+
Naming/MethodParameterName:
|
82
|
+
Enabled: false
|
83
|
+
Naming/RescuedExceptionsVariableName:
|
84
|
+
Enabled: false
|
85
|
+
Style/AccessModifierDeclarations:
|
64
86
|
Enabled: false
|
65
87
|
Style/Alias:
|
66
88
|
Enabled: false
|
67
|
-
Style/
|
68
|
-
EnforcedStyle:
|
89
|
+
Style/BlockDelimiters:
|
90
|
+
EnforcedStyle: braces_for_chaining
|
91
|
+
Style/CaseEquality:
|
92
|
+
Enabled: false
|
69
93
|
Style/CollectionMethods:
|
70
94
|
Enabled: true
|
71
95
|
Style/Documentation:
|
72
96
|
Enabled: false
|
73
97
|
Style/EachWithObject:
|
74
98
|
Enabled: false
|
99
|
+
Style/EmptyElse:
|
100
|
+
Enabled: false
|
75
101
|
Style/EmptyMethod:
|
76
102
|
EnforcedStyle: expanded
|
77
103
|
Style/FormatString:
|
@@ -94,6 +120,8 @@ Style/NegatedIf:
|
|
94
120
|
Enabled: false
|
95
121
|
Style/NegatedWhile:
|
96
122
|
Enabled: false
|
123
|
+
Style/NumericPredicate:
|
124
|
+
Enabled: false
|
97
125
|
Style/OneLineConditional:
|
98
126
|
Enabled: false
|
99
127
|
Style/PercentLiteralDelimiters:
|
@@ -102,6 +130,8 @@ Style/PreferredHashMethods:
|
|
102
130
|
Enabled: false
|
103
131
|
Style/RaiseArgs:
|
104
132
|
Enabled: false
|
133
|
+
Style/RedundantRegexpCharacterClass:
|
134
|
+
Enabled: false
|
105
135
|
Style/SafeNavigation:
|
106
136
|
Enabled: false
|
107
137
|
Style/Send:
|
@@ -119,12 +149,12 @@ Style/StringMethods:
|
|
119
149
|
Style/SymbolArray:
|
120
150
|
Enabled: false
|
121
151
|
Style/TrailingCommaInArguments:
|
122
|
-
EnforcedStyleForMultiline:
|
152
|
+
EnforcedStyleForMultiline: no_comma
|
123
153
|
Style/TrailingCommaInArrayLiteral:
|
124
|
-
EnforcedStyleForMultiline:
|
154
|
+
EnforcedStyleForMultiline: no_comma
|
125
155
|
Style/TrailingCommaInHashLiteral:
|
126
|
-
EnforcedStyleForMultiline:
|
127
|
-
Style/
|
156
|
+
EnforcedStyleForMultiline: no_comma
|
157
|
+
Style/RedundantCondition:
|
128
158
|
Enabled: false
|
129
159
|
Style/WhileUntilModifier:
|
130
160
|
Enabled: false
|
data/Gemfile
CHANGED
@@ -3,3 +3,11 @@ source "https://rubygems.org"
|
|
3
3
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
4
|
|
5
5
|
gemspec
|
6
|
+
|
7
|
+
gem "bundler"
|
8
|
+
gem "pry-byebug"
|
9
|
+
gem "rake"
|
10
|
+
gem "rspec"
|
11
|
+
gem "rubocop"
|
12
|
+
gem "snowglobe", github: "mcmire/snowglobe"
|
13
|
+
gem "super_diff"
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -25,14 +25,14 @@ gem install warnings_logger
|
|
25
25
|
## Usage
|
26
26
|
|
27
27
|
To use this gem, place the following in `spec/spec_helper.rb` or
|
28
|
-
`test/test_helper.rb`, replacing
|
29
|
-
you're developing:
|
28
|
+
`test/test_helper.rb`, replacing your project name as needed:
|
30
29
|
|
31
30
|
``` ruby
|
32
|
-
WarningsLogger
|
33
|
-
project_name
|
34
|
-
project_directory
|
35
|
-
|
31
|
+
WarningsLogger.configure do |config|
|
32
|
+
config.project_name = "my_project_name_goes_here"
|
33
|
+
config.project_directory = Pathname.new("..").expand_path(__dir__)
|
34
|
+
end
|
35
|
+
WarningsLogger.enable
|
36
36
|
```
|
37
37
|
|
38
38
|
We also recommend you run your tests by enabling warnings in general. For RSpec
|
@@ -42,9 +42,9 @@ means updating your Rake::Task::TestTask by setting `t.verbose = true` and
|
|
42
42
|
setting `$VERBOSE = true` in your test helper.
|
43
43
|
|
44
44
|
With the above code in place, now when you run your tests, if your gem emits any
|
45
|
-
warnings, they will be written to a file
|
46
|
-
|
47
|
-
warning-free before you release a new version.
|
45
|
+
warnings, they will be written to a file, and the exit code of the test run will
|
46
|
+
be 1, so that your CI will fail the build. This helps you ensure that your gem
|
47
|
+
is warning-free before you release a new version.
|
48
48
|
|
49
49
|
## Developing
|
50
50
|
|
@@ -53,5 +53,5 @@ warning-free before you release a new version.
|
|
53
53
|
|
54
54
|
## Author/License
|
55
55
|
|
56
|
-
Snowglobe is © 2019 Elliot Winkler (<elliot.winkler@gmail.com>) and is
|
57
|
-
under the [MIT license](LICENSE).
|
56
|
+
Snowglobe is © 2019-2020 Elliot Winkler (<elliot.winkler@gmail.com>) and is
|
57
|
+
released under the [MIT license](LICENSE).
|
data/Rakefile
CHANGED
data/lib/warnings_logger.rb
CHANGED
@@ -1,6 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
require "warnings_logger/configuration"
|
2
|
+
require "warnings_logger/filesystem"
|
3
|
+
require "warnings_logger/partitioner"
|
4
|
+
require "warnings_logger/reader"
|
5
|
+
require "warnings_logger/reporter"
|
6
|
+
require "warnings_logger/spy"
|
7
|
+
|
8
|
+
module WarningsLogger
|
9
|
+
class << self
|
10
|
+
attr_writer :configuration
|
11
|
+
|
12
|
+
def configure(&block)
|
13
|
+
configuration.update!(&block)
|
14
|
+
end
|
15
|
+
|
16
|
+
def configuration
|
17
|
+
# rubocop:disable Naming/MemoizedInstanceVariableName
|
18
|
+
@configuration ||= Configuration.new
|
19
|
+
# rubocop:enable Naming/MemoizedInstanceVariableName
|
20
|
+
end
|
21
|
+
|
22
|
+
def enable
|
23
|
+
WarningsLogger::Spy.enable(configuration)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,10 +1,54 @@
|
|
1
|
+
require "pathname"
|
2
|
+
|
1
3
|
module WarningsLogger
|
2
4
|
class Configuration
|
3
|
-
|
5
|
+
attr_writer :project_name
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@project_name = nil
|
9
|
+
@project_directory = nil
|
10
|
+
end
|
11
|
+
|
12
|
+
def update!
|
13
|
+
yield self
|
14
|
+
end
|
15
|
+
|
16
|
+
def project_name
|
17
|
+
if @project_name
|
18
|
+
@project_name
|
19
|
+
else
|
20
|
+
raise NotConfiguredError.new(<<~EXAMPLE)
|
21
|
+
WarningsLogger.configure do |config|
|
22
|
+
config.project_name = "your_project_name"
|
23
|
+
end
|
24
|
+
EXAMPLE
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def project_directory
|
29
|
+
if @project_directory
|
30
|
+
@project_directory
|
31
|
+
else
|
32
|
+
raise NotConfiguredError.new(<<~EXAMPLE)
|
33
|
+
WarningsLogger.configure do |config|
|
34
|
+
config.project_directory = "/path/to/your/project/directory"
|
35
|
+
end
|
36
|
+
EXAMPLE
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def project_directory=(path)
|
41
|
+
@project_directory = Pathname.new(path)
|
42
|
+
end
|
43
|
+
|
44
|
+
class NotConfiguredError < StandardError
|
45
|
+
def initialize(example)
|
46
|
+
super(<<~MESSAGE)
|
47
|
+
You need to configure WarningsLogger before you can use it! For example:
|
4
48
|
|
5
|
-
|
6
|
-
|
7
|
-
|
49
|
+
#{example}
|
50
|
+
MESSAGE
|
51
|
+
end
|
8
52
|
end
|
9
53
|
end
|
10
54
|
end
|
@@ -2,12 +2,8 @@ require "fileutils"
|
|
2
2
|
|
3
3
|
module WarningsLogger
|
4
4
|
class Filesystem
|
5
|
-
ROOT_TEMPORARY_DIRECTORY = Pathname.new("/tmp/warnings_logger")
|
6
|
-
|
7
5
|
def initialize(configuration)
|
8
|
-
@
|
9
|
-
configuration.project_name,
|
10
|
-
)
|
6
|
+
@configuration = configuration
|
11
7
|
@files_by_name = Hash.new do |hash, name|
|
12
8
|
hash[name] = file_for(name)
|
13
9
|
end
|
@@ -35,7 +31,7 @@ module WarningsLogger
|
|
35
31
|
|
36
32
|
private
|
37
33
|
|
38
|
-
attr_reader :
|
34
|
+
attr_reader :configuration, :files_by_name
|
39
35
|
|
40
36
|
def file_for(name)
|
41
37
|
path_for(name).open("w+")
|
@@ -44,5 +40,9 @@ module WarningsLogger
|
|
44
40
|
def path_for(name)
|
45
41
|
temporary_directory.join("#{name}.txt")
|
46
42
|
end
|
43
|
+
|
44
|
+
def temporary_directory
|
45
|
+
configuration.project_directory.join("tmp/warnings_logger")
|
46
|
+
end
|
47
47
|
end
|
48
48
|
end
|
@@ -23,34 +23,41 @@ module WarningsLogger
|
|
23
23
|
|
24
24
|
def_delegators :configuration, :project_name
|
25
25
|
|
26
|
-
def_delegators
|
27
|
-
:
|
26
|
+
def_delegators(
|
27
|
+
:filesystem,
|
28
|
+
:warnings_file,
|
29
|
+
:relevant_warnings_file,
|
30
|
+
:irrelevant_warnings_file
|
31
|
+
)
|
28
32
|
|
29
|
-
def_delegators
|
33
|
+
def_delegators(
|
34
|
+
:partitioner,
|
35
|
+
:relevant_warning_groups,
|
30
36
|
:irrelevant_warning_groups
|
37
|
+
)
|
31
38
|
|
32
39
|
def reporting_all_groups
|
33
40
|
if relevant_warning_groups.any? || irrelevant_warning_groups.any?
|
34
|
-
|
41
|
+
warn ""
|
35
42
|
yield
|
36
|
-
|
37
|
-
|
43
|
+
warn "All warnings were written to #{warnings_file.path}."
|
44
|
+
warn ""
|
38
45
|
end
|
39
46
|
end
|
40
47
|
|
41
48
|
def report_relevant_warning_groups
|
42
49
|
if relevant_warning_groups.any?
|
43
|
-
print_divider("-", 75, header: " #{project_name} warnings:")
|
50
|
+
print_divider("-", 75, header: " #{project_name} warnings: ")
|
44
51
|
relevant_warning_groups.each do |group|
|
45
52
|
group.each do |line|
|
46
53
|
relevant_warnings_file.puts(line)
|
47
|
-
|
54
|
+
warn line
|
48
55
|
end
|
49
56
|
end
|
50
57
|
print_divider("-", 75)
|
51
|
-
|
58
|
+
warn(
|
52
59
|
"#{project_name} warnings written to " +
|
53
|
-
"#{relevant_warnings_file.path}."
|
60
|
+
"#{relevant_warnings_file.path}."
|
54
61
|
)
|
55
62
|
end
|
56
63
|
end
|
@@ -62,29 +69,29 @@ module WarningsLogger
|
|
62
69
|
irrelevant_warnings_file.puts(line)
|
63
70
|
end
|
64
71
|
end
|
65
|
-
|
72
|
+
warn(
|
66
73
|
"Non #{project_name} warnings were raised during the test run. " +
|
67
|
-
"These have been written to #{irrelevant_warnings_file.path}."
|
74
|
+
"These have been written to #{irrelevant_warnings_file.path}."
|
68
75
|
)
|
69
76
|
end
|
70
77
|
end
|
71
78
|
|
72
79
|
def print_divider(character, count, options = {})
|
73
|
-
|
80
|
+
warn
|
74
81
|
|
75
82
|
if options[:header]
|
76
83
|
first_count = 10
|
77
|
-
second_count = options[:header].length - first_count
|
84
|
+
second_count = count - options[:header].length - first_count
|
78
85
|
string =
|
79
86
|
horizontal_rule(character, first_count) +
|
80
87
|
options[:header] +
|
81
88
|
horizontal_rule(character, second_count)
|
82
|
-
|
89
|
+
warn string
|
83
90
|
else
|
84
|
-
|
91
|
+
warn horizontal_rule(character, count)
|
85
92
|
end
|
86
93
|
|
87
|
-
|
94
|
+
warn
|
88
95
|
end
|
89
96
|
|
90
97
|
def horizontal_rule(character, count)
|
data/lib/warnings_logger/spy.rb
CHANGED
@@ -3,9 +3,19 @@ require "forwardable"
|
|
3
3
|
module WarningsLogger
|
4
4
|
# Adapted from <http://myronmars.to/n/dev-blog/2011/08/making-your-gem-warning-free>
|
5
5
|
class Spy
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
# DEPRECATED
|
7
|
+
def self.call(**options)
|
8
|
+
WarningsLogger.configure do |config|
|
9
|
+
options.each do |key, value|
|
10
|
+
config.public_send("#{key}=", value)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
WarningsLogger.enable
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.enable(configuration)
|
18
|
+
new(configuration).enable
|
9
19
|
end
|
10
20
|
|
11
21
|
extend Forwardable
|
@@ -15,19 +25,21 @@ module WarningsLogger
|
|
15
25
|
@reader = Reader.new(filesystem)
|
16
26
|
@partitioner = Partitioner.new(
|
17
27
|
configuration: configuration,
|
18
|
-
reader: reader
|
28
|
+
reader: reader
|
19
29
|
)
|
20
30
|
@reporter = Reporter.new(
|
21
31
|
configuration: configuration,
|
22
32
|
filesystem: filesystem,
|
23
|
-
partitioner: partitioner
|
33
|
+
partitioner: partitioner
|
24
34
|
)
|
35
|
+
|
36
|
+
@original_stderr = nil
|
25
37
|
end
|
26
38
|
|
27
|
-
def
|
39
|
+
def enable
|
28
40
|
filesystem.prepare
|
29
41
|
capture_warnings
|
30
|
-
|
42
|
+
report_warnings_after_tests_run
|
31
43
|
end
|
32
44
|
|
33
45
|
private
|
@@ -36,17 +48,48 @@ module WarningsLogger
|
|
36
48
|
|
37
49
|
def_delegators :filesystem, :warnings_file
|
38
50
|
|
39
|
-
def_delegators
|
51
|
+
def_delegators(
|
52
|
+
:partitioner,
|
53
|
+
:relevant_warning_groups,
|
40
54
|
:irrelevant_warning_groups
|
55
|
+
)
|
41
56
|
|
42
57
|
def capture_warnings
|
58
|
+
@original_stderr = $stderr.dup
|
43
59
|
$stderr.reopen(warnings_file.path)
|
44
60
|
end
|
45
61
|
|
46
|
-
def
|
47
|
-
|
48
|
-
|
49
|
-
|
62
|
+
def release_warnings
|
63
|
+
$stderr.reopen(@original_stderr)
|
64
|
+
end
|
65
|
+
|
66
|
+
def report_warnings_after_tests_run
|
67
|
+
spy = self
|
68
|
+
|
69
|
+
if should_integrate_with_rspec?
|
70
|
+
RSpec.configure do |config|
|
71
|
+
config.after(:suite) do
|
72
|
+
spy.instance_eval do
|
73
|
+
release_warnings
|
74
|
+
printing_exceptions do
|
75
|
+
report_and_possibly_fail
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
elsif should_integrate_with_minitest?
|
81
|
+
Minitest.after_run do
|
82
|
+
release_warnings
|
83
|
+
printing_exceptions do
|
84
|
+
report_and_possibly_fail
|
85
|
+
end
|
86
|
+
end
|
87
|
+
else
|
88
|
+
at_exit do
|
89
|
+
release_warnings
|
90
|
+
printing_exceptions do
|
91
|
+
report_and_possibly_fail
|
92
|
+
end
|
50
93
|
end
|
51
94
|
end
|
52
95
|
end
|
@@ -54,21 +97,21 @@ module WarningsLogger
|
|
54
97
|
def printing_exceptions
|
55
98
|
yield
|
56
99
|
rescue StandardError => error
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
100
|
+
warn "\n--- ERROR IN AT_EXIT --------------------------------"
|
101
|
+
warn "#{error.class}: #{error.message}"
|
102
|
+
warn error.backtrace.join("\n")
|
103
|
+
warn "-----------------------------------------------------"
|
61
104
|
raise error
|
62
105
|
end
|
63
106
|
|
64
|
-
def
|
107
|
+
def report_and_possibly_fail
|
65
108
|
reader.read
|
66
109
|
partitioner.partition
|
67
110
|
|
68
111
|
if relevant_warning_groups.any?
|
69
112
|
report_warnings_and_fail
|
70
113
|
else
|
71
|
-
|
114
|
+
print_warnings
|
72
115
|
end
|
73
116
|
end
|
74
117
|
|
@@ -77,9 +120,17 @@ module WarningsLogger
|
|
77
120
|
exit(1)
|
78
121
|
end
|
79
122
|
|
80
|
-
def
|
123
|
+
def print_warnings
|
81
124
|
filesystem.warnings_file.rewind
|
82
125
|
puts filesystem.warnings_file.read
|
83
126
|
end
|
127
|
+
|
128
|
+
def should_integrate_with_rspec?
|
129
|
+
defined?(RSpec)
|
130
|
+
end
|
131
|
+
|
132
|
+
def should_integrate_with_minitest?
|
133
|
+
defined?(Minitest) && Minitest.class_variable_get("@@installed_at_exit")
|
134
|
+
end
|
84
135
|
end
|
85
136
|
end
|
data/warnings_logger.gemspec
CHANGED
@@ -36,8 +36,4 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.bindir = "exe"
|
37
37
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
38
38
|
spec.require_paths = ["lib"]
|
39
|
-
|
40
|
-
spec.add_development_dependency "bundler", "~> 1.17"
|
41
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
42
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
43
39
|
end
|
metadata
CHANGED
@@ -1,58 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warnings_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Winkler
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.17'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.17'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
|
-
description:
|
11
|
+
date: 2020-08-23 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
56
14
|
email:
|
57
15
|
- elliot.winkler@gmail.com
|
58
16
|
executables: []
|
@@ -60,9 +18,7 @@ extensions: []
|
|
60
18
|
extra_rdoc_files: []
|
61
19
|
files:
|
62
20
|
- ".gitignore"
|
63
|
-
- ".rspec"
|
64
21
|
- ".rubocop.yml"
|
65
|
-
- ".travis.yml"
|
66
22
|
- Gemfile
|
67
23
|
- LICENSE
|
68
24
|
- README.md
|
@@ -83,7 +39,7 @@ metadata:
|
|
83
39
|
allowed_push_host: https://rubygems.org
|
84
40
|
homepage_uri: https://github.com/mcmire/warnings_logger
|
85
41
|
source_code_uri: https://github.com/mcmire/warnings_logger
|
86
|
-
post_install_message:
|
42
|
+
post_install_message:
|
87
43
|
rdoc_options: []
|
88
44
|
require_paths:
|
89
45
|
- lib
|
@@ -98,9 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
54
|
- !ruby/object:Gem::Version
|
99
55
|
version: '0'
|
100
56
|
requirements: []
|
101
|
-
|
102
|
-
|
103
|
-
signing_key:
|
57
|
+
rubygems_version: 3.1.2
|
58
|
+
signing_key:
|
104
59
|
specification_version: 4
|
105
60
|
summary: Easily log warnings in your gems
|
106
61
|
test_files: []
|
data/.rspec
DELETED