activetodo 0.0.5 → 0.0.6
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/.travis.yml +4 -2
- data/lib/activetodo.rb +10 -0
- data/lib/activetodo/version.rb +1 -1
- data/spec/activetodo_spec.rb +12 -0
- metadata +18 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c97898598fea65920bd2621700b0218eff752e93
|
4
|
+
data.tar.gz: 545fdd323164c37f6f922d01fe56297938597e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f5172d9f1ffa81142fc45b63b1a61fb2a2e7f39c1ac769565aeb779165c91f24250cbe87a185cbeb94e0218b14ed0b23ecedbbbb1beb875dc48a7897445fdc9
|
7
|
+
data.tar.gz: 37191fe6d68c075cd480dd3d1fe0dd3ad2c786ca11ea283187bfcc19f49afee4e846640eee81f4ca67c2443164a560dc5d4543f6fe60214c3258ac86d0ce4c81
|
data/.travis.yml
CHANGED
data/lib/activetodo.rb
CHANGED
@@ -21,6 +21,14 @@ module ActiveTodo
|
|
21
21
|
def ignore_production=(condition)
|
22
22
|
@@ignore_production = condition
|
23
23
|
end
|
24
|
+
|
25
|
+
def show_callsite?
|
26
|
+
@@show_callsite ||= false
|
27
|
+
end
|
28
|
+
|
29
|
+
def show_callsite=(condition)
|
30
|
+
@@show_callsite = condition
|
31
|
+
end
|
24
32
|
end
|
25
33
|
end
|
26
34
|
|
@@ -47,9 +55,11 @@ module ActiveTodo
|
|
47
55
|
|
48
56
|
def TODO(what, options = {})
|
49
57
|
deadline = DateTime.parse(options[:deadline]) if options[:deadline]
|
58
|
+
callsite = caller.first if Configuration.show_callsite?
|
50
59
|
|
51
60
|
if deadline && DateTime.now >= deadline
|
52
61
|
message = "Deadline reached for \"#{what}\" (#{options[:deadline]})"
|
62
|
+
message += " in #{callsite}" if callsite
|
53
63
|
|
54
64
|
if Configuration.warn_only?(options)
|
55
65
|
PrivateMethods.log_message(message, options)
|
data/lib/activetodo/version.rb
CHANGED
data/spec/activetodo_spec.rb
CHANGED
@@ -98,5 +98,17 @@ describe ActiveTodo::KernelMethods do
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
101
|
+
|
102
|
+
context 'when call site logging enabled' do
|
103
|
+
subject { TODO 'remove this', deadline: (Time.now - 3600).to_s }
|
104
|
+
|
105
|
+
before do
|
106
|
+
ActiveTodo.configure { |c| c.show_callsite = true }
|
107
|
+
filename_pattern = /#{Regexp.escape(Pathname(__FILE__).basename.to_s)}/
|
108
|
+
ActiveTodo::PrivateMethods.should_receive(:log_message).with(filename_pattern, anything)
|
109
|
+
end
|
110
|
+
|
111
|
+
specify { expect { subject }.not_to raise_error }
|
112
|
+
end
|
101
113
|
end
|
102
114
|
end
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activetodo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Varaneckas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: timecop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry-nav
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: This gem provides 'TOD*', 'F*XME' and 'XX*' as methods you can use in
|
@@ -88,9 +88,9 @@ executables: []
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
- .gitignore
|
92
|
-
- .rspec
|
93
|
-
- .travis.yml
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- ".travis.yml"
|
94
94
|
- Gemfile
|
95
95
|
- LICENSE
|
96
96
|
- README.md
|
@@ -110,21 +110,20 @@ require_paths:
|
|
110
110
|
- lib
|
111
111
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
|
-
- -
|
113
|
+
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
|
-
- -
|
118
|
+
- - ">="
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.6.8
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Forget 'TOD*' comments that are sitting in your code forever
|
127
127
|
test_files:
|
128
128
|
- spec/activetodo_spec.rb
|
129
129
|
- spec/spec_helper.rb
|
130
|
-
has_rdoc:
|