fixme 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/lib/fixme.rb +2 -0
- data/lib/fixme/version.rb +1 -1
- data/spec/fixme_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a739fb14f76d1ecaf78b09daa1ef1bb44d3619dc
|
4
|
+
data.tar.gz: 6b4463e54b2eb7c81324fc0d26498b494db25eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f07137de06cedb7e5141b04f87e2573c3f625068e58bdd7f0b132ec6b3405768d20e5c708c02f729151e6ca9200480f3d0d557d9c4d98f891536c6c1aedb6abf
|
7
|
+
data.tar.gz: fd5d5a33abe502db63b0e18dc144d5e4b36197791647e0f1482cd68da5d80697e3f2cb323fcd2d769bbd89247acd23f4c41a66b768f7b9ae3a59591b477618b1
|
data/README.md
CHANGED
@@ -7,17 +7,25 @@ FIXME "2014-07-31: Stop hard-coding currency."
|
|
7
7
|
currency = "USD"
|
8
8
|
```
|
9
9
|
|
10
|
-
|
10
|
+
This library makes a `FIXME()` method available everywhere.
|
11
|
+
|
12
|
+
Starting July 31st 2014, the "FIXME" line in the example above would raise `Fixme::UnfixedError` with the message `"Fix by 2014-07-31: Stop hard-coding currency."`
|
13
|
+
|
14
|
+
You may want to use these bad boys next to:
|
11
15
|
|
12
16
|
* Temporary quick fixes, to ensure they really *are* temporary.
|
13
17
|
* Code that supports legacy workflows during a transitional period.
|
14
18
|
* Experiments, to remember to evaluate them and make a decision.
|
15
19
|
* Anything else you can't do now but should fix later.
|
16
20
|
|
17
|
-
Starting July 31st 2014, the "FIXME" line in the example above would start raising an exception with the given message.
|
18
|
-
|
19
21
|
If `Rails.environment` (Ruby on Rails) or `ENV["RACK_ENV"]` (e.g. Sinatra) is present, it will only ever raise in the `"test"` and `"development"` environments. That is, the production app will never raise these exceptions.
|
20
22
|
|
23
|
+
If you don't want your CI server to raise, make it set the environment variable `DO_NOT_RAISE_FIXMES`. I like having CI raise them, though.
|
24
|
+
|
25
|
+
Protip: make sure it's clear from the exception or from a separate comment just what should be done – sometimes not even the person who wrote the quickfix will remember what you're meant to change.
|
26
|
+
|
27
|
+
This library is an extraction of a helper (originally called `wip_raise`) we tried and liked at [Barsoom](http://barsoom.se).
|
28
|
+
|
21
29
|
|
22
30
|
## Installation
|
23
31
|
|
data/lib/fixme.rb
CHANGED
data/lib/fixme/version.rb
CHANGED
data/spec/fixme_spec.rb
CHANGED
@@ -19,6 +19,7 @@ describe Fixme, "#TODO" do
|
|
19
19
|
}.not_to raise_error
|
20
20
|
end
|
21
21
|
|
22
|
+
# Had a bug with ": " in the message.
|
22
23
|
it "parses the date and message flawlessly" do
|
23
24
|
expect {
|
24
25
|
FIXME "2013-12-31: Remove this: and this."
|
@@ -55,6 +56,10 @@ describe Fixme, "#TODO" do
|
|
55
56
|
end
|
56
57
|
|
57
58
|
context "when a Rack environment is detected" do
|
59
|
+
before do
|
60
|
+
ENV.stub(:[]).with("DO_NOT_RAISE_FIXMES")
|
61
|
+
end
|
62
|
+
|
58
63
|
it "raises in the 'test' environment" do
|
59
64
|
ENV.stub(:[]).with("RACK_ENV").and_return("test")
|
60
65
|
expect_to_raise
|
@@ -71,6 +76,11 @@ describe Fixme, "#TODO" do
|
|
71
76
|
end
|
72
77
|
end
|
73
78
|
|
79
|
+
it "does not raise when the DO_NOT_RAISE_FIXMES environment variable is set" do
|
80
|
+
ENV.stub(:[]).with("DO_NOT_RAISE_FIXMES").and_return("true")
|
81
|
+
expect_not_to_raise
|
82
|
+
end
|
83
|
+
|
74
84
|
private
|
75
85
|
|
76
86
|
def expect_to_raise
|