tombstone 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 +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +55 -0
- data/Rakefile +2 -0
- data/bin/tombstone +5 -0
- data/lib/tombstone.rb +19 -0
- data/lib/tombstone/railtie.rb +9 -0
- data/lib/tombstone/version.rb +3 -0
- data/tombstone.gemspec +23 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b4a3886077bcac3593ddafe0e78496ea2db0252d
|
4
|
+
data.tar.gz: e4d595417748732960587423c392424a97cb0e65
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7bbc2ea1ef642701e33af3bebc77a58a2b40b89b9cce89ff9dde31b0bc28903d2fb1c0dd411873211e71db8369dabb3e862ee8acb57d0a75cdf92355f82091f0
|
7
|
+
data.tar.gz: 8b7b82260e6f91988eb5f6358215c823cdb2214c2e36e7729ca2d5fdd79d0bc4f48fa19802c50cceae6ab3914c8034f4662f33d6dd3eeee0aa93e59ccc949577
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Lewis Buckley
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# Tombstone Introduction
|
2
|
+
|
3
|
+
Inspired by David Schnepper's Ignite talk **"Isn't That Code Dead?" - Velocity Santa Clara 2014**
|
4
|
+
|
5
|
+
<a href="http://www.youtube.com/watch?feature=player_embedded&v=29UXzfQWOhQ
|
6
|
+
" target="_blank"><img src="http://img.youtube.com/vi/29UXzfQWOhQ/0.jpg"
|
7
|
+
alt="Tombstone Youtube Video" width="240" height="180" border="10" /></a>
|
8
|
+
|
9
|
+
## Requirements
|
10
|
+
|
11
|
+
Ruby 2.0 or above
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add this line to your application's Gemfile:
|
16
|
+
|
17
|
+
gem 'tombstone', github: 'lewispb/tombstone'
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install tombstone
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Not sure if some code is safe to remove? Tombstone it.
|
30
|
+
|
31
|
+
Place a Tombstone in your code as follows:
|
32
|
+
|
33
|
+
Tombstone.place('YOUR_LABEL')
|
34
|
+
|
35
|
+
You can use todays date as a label, to remind yourself of when you placed the Tombstone. When a Tombstone is encountered it will output to your rails development log like so:
|
36
|
+
|
37
|
+
Tombstone: 2014-11-01 - index - /Users/lewispb/projects/railsapp/app/controllers/welcome_controller.rb Line #: 5
|
38
|
+
|
39
|
+
You can use the following command to search your development log for Tombstones. From the root of your rails app run:
|
40
|
+
|
41
|
+
bundle exec tombstone
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
All contributions very welcome
|
46
|
+
|
47
|
+
### Todo
|
48
|
+
- Test with non Rails apps
|
49
|
+
- Write some tests
|
50
|
+
|
51
|
+
1. Fork it ( https://github.com/[my-github-username]/tombstone/fork )
|
52
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
53
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
54
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
55
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/tombstone
ADDED
data/lib/tombstone.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "tombstone/version"
|
2
|
+
require 'tombstone/railtie' if defined?(Rails)
|
3
|
+
|
4
|
+
module Tombstone
|
5
|
+
|
6
|
+
def self.logger
|
7
|
+
@logger ||= Logger.new(STDERR)
|
8
|
+
end
|
9
|
+
|
10
|
+
def place(date_string = '')
|
11
|
+
backtrace = caller_locations(1,1)[0]
|
12
|
+
message = "Tombstone: #{date_string} - #{backtrace.label} - #{backtrace.absolute_path} Line #: #{backtrace.lineno}"
|
13
|
+
logger.warn message
|
14
|
+
# Outputs the above message to the console, colored red
|
15
|
+
puts "\e[31m#{message}\e[0m"
|
16
|
+
end
|
17
|
+
module_function :place
|
18
|
+
|
19
|
+
end
|
data/tombstone.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tombstone/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tombstone"
|
8
|
+
spec.version = Tombstone::VERSION
|
9
|
+
spec.authors = ["Lewis Buckley"]
|
10
|
+
spec.email = ["lewis@lewisbuckley.co.uk"]
|
11
|
+
spec.summary = %q{Use Tombstone to highlight dead code.}
|
12
|
+
spec.description = %q{Use Tombstone to highlight dead code. Not sure if some code is safe to remove? Tombstone it.}
|
13
|
+
spec.homepage = "https://github.com/lewispb/tombstone"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = ["tombstone"]
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tombstone
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lewis Buckley
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Use Tombstone to highlight dead code. Not sure if some code is safe to
|
42
|
+
remove? Tombstone it.
|
43
|
+
email:
|
44
|
+
- lewis@lewisbuckley.co.uk
|
45
|
+
executables:
|
46
|
+
- tombstone
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- .gitignore
|
51
|
+
- Gemfile
|
52
|
+
- LICENSE.txt
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- bin/tombstone
|
56
|
+
- lib/tombstone.rb
|
57
|
+
- lib/tombstone/railtie.rb
|
58
|
+
- lib/tombstone/version.rb
|
59
|
+
- tombstone.gemspec
|
60
|
+
homepage: https://github.com/lewispb/tombstone
|
61
|
+
licenses:
|
62
|
+
- MIT
|
63
|
+
metadata: {}
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.4.1
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: Use Tombstone to highlight dead code.
|
84
|
+
test_files: []
|