warner 1.0.0 → 1.0.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/README.md +22 -36
- data/lib/warner/version.rb +1 -1
- data/warner.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ceede9c3e8dc1130b0439eb00abd5e453d7c7ad
|
4
|
+
data.tar.gz: 1b1121e81131e995ac86b44d3f79b2c325328795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cd0cca9eecf3b1a00dfa4f9d31421d12466f0a68db6adeb3aa21b111cb0b3e46e312795da19a2e06091f30b2a0973ad2b6ab20e6d95662d9992cdcc66434dc0
|
7
|
+
data.tar.gz: 2a96186f30aac6b50fbc189d587c5a4bfdb30a1a2e5026527dab4c71ebdfe596a307138ccf7d0ed9618267181c9531adf49a7d1ee6cc727c203dfe3a23014eb8
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Warner
|
2
2
|
|
3
|
-
[ ](https://app.codeship.com/projects/246699)
|
3
|
+
[](https://badge.fury.io/rb/warner) [](https://app.codeship.com/projects/246699)
|
4
4
|
|
5
|
-
|
5
|
+
Annotate your code w/ custom deprecation warnings to the `$stderr` when a newer version of a gem or rails is installed. Especially useful for monkeypatching.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -24,65 +24,51 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
### `Warner.gem_version_warning`
|
26
26
|
|
27
|
-
Display a message when specified is updated and needs a change
|
28
|
-
e.g. when monkeypatching a gem: put the code into the monkey patch
|
27
|
+
Display a message when specified is updated and needs a change.
|
29
28
|
|
30
29
|
```ruby
|
31
30
|
# app/monkeypatches/bootstrap_form.rb
|
32
|
-
Warner.gem_version_warning('bootstrap_form', "1.2", "
|
33
|
-
|
34
|
-
module BootstrapForm
|
35
|
-
...
|
36
|
-
end
|
31
|
+
Warner.gem_version_warning('bootstrap_form', "1.2", "upgrade to latest version")
|
37
32
|
```
|
38
33
|
|
39
|
-
will output
|
34
|
+
will output:
|
40
35
|
|
41
|
-
```
|
42
|
-
|
36
|
+
```log
|
37
|
+
DEPRECATION WARNING: [gem:bootstrap_form] 2.7.0 > 1.2 : upgrade to latest version (called from <top (required)> at /Users/berl/Clients/bwh/core/app/monkeypatches/bootstrap_form.rb:1)
|
43
38
|
```
|
44
|
-
|
39
|
+
---
|
45
40
|
|
46
41
|
### `Warner.rails_version_warning`
|
47
42
|
|
48
|
-
Display a message when rails is updated and needs a change
|
49
|
-
e.g. when monkeypatching a gem put the code into the monkey patch
|
43
|
+
Display a message when rails is updated and needs a change.
|
50
44
|
|
51
45
|
```ruby
|
52
46
|
# app/monkeypatches/bootstrap_form.rb
|
53
|
-
Warner.rails_version_warning("
|
54
|
-
|
55
|
-
module BootstrapForm
|
56
|
-
...
|
57
|
-
end
|
47
|
+
Warner.rails_version_warning("5.0", "Remove this monkeypatch b/c it's fixed in 5.1 (see issue #99999)")
|
58
48
|
```
|
59
49
|
|
60
|
-
will output
|
50
|
+
will output:
|
61
51
|
|
62
|
-
```
|
63
|
-
|
52
|
+
```log
|
53
|
+
DEPRECATION WARNING: [RAILS] 5.1.6 > 5.0 : Remove this monkeypatch b/c it's fixed in 5.1 (see issue #99999) (called from <top (required)> at /Users/berl/Clients/bwh/core/app/monkeypatches/bootstrap_form.rb:1)
|
64
54
|
```
|
65
55
|
|
66
|
-
|
67
|
-
|
68
|
-
class MyMailer < ActionMailer::Base
|
69
|
-
|
70
|
-
Warner.rails_version_warning("3.2", "REMOVE: MyMailer#default_i18n_subject is a copy of 4.0 implementations")
|
56
|
+
---
|
57
|
+
### `Warner.colored_warning`
|
71
58
|
|
72
|
-
|
73
|
-
...
|
74
|
-
end
|
59
|
+
Just display a message w/o any checking of versions
|
75
60
|
|
76
|
-
|
61
|
+
```ruby
|
62
|
+
# app/monkeypatches/bootstrap_form.rb
|
63
|
+
Warner.colored_warning("Somebody look at this piece of code please!")
|
77
64
|
```
|
78
65
|
|
79
|
-
will output
|
66
|
+
will output:
|
80
67
|
|
81
|
-
```
|
82
|
-
|
68
|
+
```log
|
69
|
+
DEPRECATION WARNING: Somebody look at this piece of code please! (called from <top (required)> at /Users/berl/Clients/bwh/core/app/monkeypatches/bootstrap_form.rb:1)
|
83
70
|
```
|
84
71
|
|
85
|
-
|
86
72
|
## Development
|
87
73
|
|
88
74
|
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
data/lib/warner/version.rb
CHANGED
data/warner.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Leon Berenschot"]
|
10
10
|
spec.email = ["leipeleon@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{Annotate your code w/ custom deprecation warnings}
|
13
|
+
spec.description = %q{for exampele when a newer version of a gem or rails is installed. Especially useful for monkeypatching.}
|
14
14
|
spec.homepage = "https://github.com/LeipeLeon/warner"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leon Berenschot
|
@@ -108,8 +108,8 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
description:
|
112
|
-
|
111
|
+
description: for exampele when a newer version of a gem or rails is installed. Especially
|
112
|
+
useful for monkeypatching.
|
113
113
|
email:
|
114
114
|
- leipeleon@gmail.com
|
115
115
|
executables: []
|
@@ -154,5 +154,5 @@ rubyforge_project:
|
|
154
154
|
rubygems_version: 2.6.13
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
|
-
summary:
|
157
|
+
summary: Annotate your code w/ custom deprecation warnings
|
158
158
|
test_files: []
|