doofenshmirtz 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +41 -5
- data/doofenshmirtz.gemspec +1 -0
- data/lib/doofenshmirtz/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bca3e03e2c00393880d37a307456d852705e461
|
4
|
+
data.tar.gz: a353edb1f0c424c6920590f3872b49fd07fe1419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc6fc6ea130397d69a54fe613cb4a7e29d200f04e42050c3d10d65226bf3d643bf37071eef9e04986f1b8373c6fe4ef1ea88649d1861e66c87a0f48b4e76d697
|
7
|
+
data.tar.gz: 81a8b7f450e3e3425418ade54d7500f3b22cff918a4e1a023b8a2312e0c6235f4efa197d4f5e83d6b695a5f0e9b799bf688df81c864d12ad405cd2e87fe76ffb
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Doofenshmirtz
|
2
2
|
|
3
|
+
## Usage
|
4
|
+
|
3
5
|
Let your Rails code self destruct in tests.
|
4
6
|
|
5
7
|
Set an expiration date anywhere:
|
@@ -8,9 +10,47 @@ Set an expiration date anywhere:
|
|
8
10
|
Doofenshmirtz::SelfDestruct.on(“2015-05-09”)
|
9
11
|
```
|
10
12
|
|
13
|
+
|
11
14
|
and watch it explode if the code is still around on that date. You’ll also
|
12
15
|
get warning messages in you test output to let you know that that there
|
13
|
-
are self
|
16
|
+
are self descruction mechanisms in the code and when they will blow up.
|
17
|
+
|
18
|
+
## Reporting
|
19
|
+
|
20
|
+
|
21
|
+
You can put the following in an `after_suite` callback (or anywhere really)
|
22
|
+
and output what self destruct mechanisms are currently enabled.
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
Doofenshmirtz::SelfDestruct.report
|
26
|
+
```
|
27
|
+
|
28
|
+
You can also pass a custom report. All you need to implement is a `#report`
|
29
|
+
method.
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
Doofenshmirtz::SelfDestruct.report(MyCustomerReporter)
|
33
|
+
```
|
34
|
+
|
35
|
+
Here is an example of a simple one that prints to stdout:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
class MyCustomerReporter
|
39
|
+
attr_accessor :mechanisms
|
40
|
+
|
41
|
+
def initialize(mechanisms)
|
42
|
+
self.mechanisms = mechanisms
|
43
|
+
end
|
44
|
+
|
45
|
+
def report
|
46
|
+
mechanisms.each do |m|
|
47
|
+
puts m.location
|
48
|
+
puts m.time
|
49
|
+
puts m.reason
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
```
|
14
54
|
|
15
55
|
## Installation
|
16
56
|
|
@@ -28,10 +68,6 @@ Or install it yourself as:
|
|
28
68
|
|
29
69
|
$ gem install doofenshmirtz
|
30
70
|
|
31
|
-
## Usage
|
32
|
-
|
33
|
-
TODO: Write usage instructions here
|
34
|
-
|
35
71
|
## Contributing
|
36
72
|
|
37
73
|
1. Fork it ( https://github.com/[my-github-username]/doofenshmirtz/fork )
|
data/doofenshmirtz.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_dependency "colorize", "~> 0.7"
|
21
22
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
24
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doofenshmirtz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bohn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colorize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.7'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|