uncruft 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/uncruft/version.rb +1 -1
- data/lib/uncruft/warning.rb +1 -1
- data/spec/examples.txt +23 -22
- data/spec/uncruft/warning_spec.rb +5 -0
- metadata +3 -6
- data/spec/dummy/log/test.log +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3ced48d12c51461c2bb713dcfce5b86b592f839f88effc936dace865badbcd0a
|
4
|
+
data.tar.gz: d917c8000e483c30cc0cb4a94049416c88b5eadcd5ba959ed855c64d765c212d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daf0967137adbd0c821f8237b9419cb672be5b12d2ab6b69a2d4d15d5763312de31591424fcbebf97686515ecb69327179a0b3a225145eb04af93ab727a52d0d
|
7
|
+
data.tar.gz: f2839f2318ead9bbe0bf454a7d22237b19d4ab6ea94566f3837952587cb6769ad31baf4cd9f86c4b295805a065d203cbebe544c6e29ab7e6dbf98ef487e8aacc
|
data/lib/uncruft/version.rb
CHANGED
data/lib/uncruft/warning.rb
CHANGED
@@ -2,7 +2,7 @@ module Uncruft
|
|
2
2
|
module Warning
|
3
3
|
DEPRECATION_PATTERN = /(deprecation|deprecated)/i
|
4
4
|
|
5
|
-
def warn(str)
|
5
|
+
def warn(str, *args)
|
6
6
|
if str =~ DEPRECATION_PATTERN # rubocop:disable Performance/RegexpMatch
|
7
7
|
message = strip_caller_info(str, caller_locations(1..1).first).strip
|
8
8
|
ActiveSupport::Deprecation.warn(message)
|
data/spec/examples.txt
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:2:1] | passed | 0.
|
5
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:2:2:1] | passed | 0.
|
6
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:3:1] | passed | 0.
|
7
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:4:1] | passed | 0.
|
8
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:5:1] | passed | 0.
|
9
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:6:1] | passed | 0.
|
10
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:6:2:1] | passed | 0.
|
11
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:6:3:1] | passed | 0.
|
12
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:6:3:2:1] | passed | 0.
|
13
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:7:1] | passed | 0.
|
14
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:8:1] | passed | 0.
|
15
|
-
./spec/uncruft/deprecation_handler_spec.rb[1:1:8:2:1] | passed | 0.
|
16
|
-
./spec/uncruft/railtie_spec.rb[1:1] | passed | 0.
|
17
|
-
./spec/uncruft/railtie_spec.rb[1:2:1] | passed | 0.
|
18
|
-
./spec/uncruft/railtie_spec.rb[1:3:1] | passed | 0.
|
19
|
-
./spec/uncruft/warning_spec.rb[1:1] | passed | 0.
|
20
|
-
./spec/uncruft/warning_spec.rb[1:2
|
21
|
-
./spec/uncruft/warning_spec.rb[1:
|
22
|
-
./spec/
|
23
|
-
./spec/uncruft_spec.rb[1:
|
24
|
-
./spec/uncruft_spec.rb[1:2:
|
3
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:1] | passed | 0.00273 seconds |
|
4
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:2:1] | passed | 0.01668 seconds |
|
5
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:2:2:1] | passed | 0.00367 seconds |
|
6
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:3:1] | passed | 0.00155 seconds |
|
7
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:4:1] | passed | 0.00321 seconds |
|
8
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:5:1] | passed | 0.00102 seconds |
|
9
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:6:1] | passed | 0.00113 seconds |
|
10
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:6:2:1] | passed | 0.00101 seconds |
|
11
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:6:3:1] | passed | 0.00149 seconds |
|
12
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:6:3:2:1] | passed | 0.00167 seconds |
|
13
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:7:1] | passed | 0.00084 seconds |
|
14
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:8:1] | passed | 0.004 seconds |
|
15
|
+
./spec/uncruft/deprecation_handler_spec.rb[1:1:8:2:1] | passed | 0.00316 seconds |
|
16
|
+
./spec/uncruft/railtie_spec.rb[1:1] | passed | 0.05893 seconds |
|
17
|
+
./spec/uncruft/railtie_spec.rb[1:2:1] | passed | 0.00132 seconds |
|
18
|
+
./spec/uncruft/railtie_spec.rb[1:3:1] | passed | 0.00124 seconds |
|
19
|
+
./spec/uncruft/warning_spec.rb[1:1] | passed | 0.00042 seconds |
|
20
|
+
./spec/uncruft/warning_spec.rb[1:2] | passed | 0.00014 seconds |
|
21
|
+
./spec/uncruft/warning_spec.rb[1:3:1] | passed | 0.00077 seconds |
|
22
|
+
./spec/uncruft/warning_spec.rb[1:3:2:1] | passed | 0.00059 seconds |
|
23
|
+
./spec/uncruft_spec.rb[1:1:1] | passed | 0.00281 seconds |
|
24
|
+
./spec/uncruft_spec.rb[1:2:1] | passed | 0.00027 seconds |
|
25
|
+
./spec/uncruft_spec.rb[1:2:2:1] | passed | 0.0003 seconds |
|
@@ -12,6 +12,11 @@ describe Uncruft::Warning do
|
|
12
12
|
Warning.warn('oh no, you should worry')
|
13
13
|
end
|
14
14
|
|
15
|
+
it "accepts kwargs from Kernel.warn" do
|
16
|
+
warn('oh no, you should worry', uplevel: 1)
|
17
|
+
Kernel.warn('oh no, you should worry', uplevel: 1)
|
18
|
+
end
|
19
|
+
|
15
20
|
context 'when warning includes the word "deprecation" or "deprecated"' do
|
16
21
|
it 'treats it as a deprecation warning' do
|
17
22
|
expect(ActiveSupport::Deprecation).to receive(:warn).and_return('banana').exactly(6).times
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uncruft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Griffith
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -113,7 +113,6 @@ files:
|
|
113
113
|
- lib/uncruft/warning.rb
|
114
114
|
- spec/dummy/config/application.rb
|
115
115
|
- spec/dummy/config/deprecations.ignore
|
116
|
-
- spec/dummy/log/test.log
|
117
116
|
- spec/examples.txt
|
118
117
|
- spec/spec_helper.rb
|
119
118
|
- spec/support/rails_root.rb
|
@@ -140,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
139
|
- !ruby/object:Gem::Version
|
141
140
|
version: '0'
|
142
141
|
requirements: []
|
143
|
-
|
144
|
-
rubygems_version: 2.6.13
|
142
|
+
rubygems_version: 3.0.3
|
145
143
|
signing_key:
|
146
144
|
specification_version: 4
|
147
145
|
summary: A library to assist with Rails upgrades
|
@@ -149,7 +147,6 @@ test_files:
|
|
149
147
|
- spec/spec_helper.rb
|
150
148
|
- spec/dummy/config/deprecations.ignore
|
151
149
|
- spec/dummy/config/application.rb
|
152
|
-
- spec/dummy/log/test.log
|
153
150
|
- spec/examples.txt
|
154
151
|
- spec/uncruft/railtie_spec.rb
|
155
152
|
- spec/uncruft/warning_spec.rb
|
data/spec/dummy/log/test.log
DELETED
File without changes
|