Skip to content

Commit

Permalink
rename {place => deprecated}
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Wiedler committed Jul 1, 2016
1 parent 62f0b9a commit ad9fe32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Unused code detection modeled after David Schnepper's talk (https://www.youtube.

Finding unused code can be difficult. Especially in highly dynamic environments, where it is harder to make static assurances about what is in use.

Feierabend allows you to place markers on code that you believe is no longer in use, and run that in production. If that code path gets executed, a backtrace is stored to redis, allowing you to see exactly what is using it.
Feierabend allows you to deprecated markers on code that you believe is no longer in use, and run that in production. If that code path gets executed, a backtrace is stored to redis, allowing you to see exactly what is using it.

By following a convention of including a date in the label (though some `git blame` magic could do the same) it becomes possible to filter markers by age, giving you increasing confidence that code can be cleaned up.

Expand All @@ -23,7 +23,7 @@ Here's an out-of-context Dijkstra quote for good measure:

### Form hypothesis on unused code

Travis::Feierabend.place('2016-07-01/no-longer-needed-code')
Travis::Feierabend.deprecated('2016-07-01/no-longer-needed-code')

### Verify or refute hypothesis

Expand Down
6 changes: 3 additions & 3 deletions lib/travis/feierabend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def initialize(storage)
@storage = storage
end

def place(label, meta={})
def deprecated(label, meta={})
data = {
trace: Kernel.caller_locations.join("\n"),
meta: meta,
Expand Down Expand Up @@ -38,8 +38,8 @@ def instance
@instance ||= Feierabend.new(storage)
end

def place(label, meta={})
instance.place(label, meta)
def deprecated(label, meta={})
instance.deprecated(label, meta)
end

def list_in_use(label)
Expand Down
6 changes: 3 additions & 3 deletions spec/tombstone_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
require 'travis/feierabend/memory_storage'
require 'travis/feierabend/redis_storage'

RSpec.describe Travis::Feierabend, "#place" do
RSpec.describe Travis::Feierabend, "#deprecated" do
context "memory storage" do
before {
Travis::Feierabend.configure { Travis::Feierabend::MemoryStorage.new }
}

it "stores a refutation" do
Travis::Feierabend.place('2016-07-01/test-case')
Travis::Feierabend.deprecated('2016-07-01/test-case')
expect(Travis::Feierabend.get_refutations('2016-07-01/test-case').count).to be(1)
end
end
Expand All @@ -25,7 +25,7 @@
}

it "stores a refutation" do
Travis::Feierabend.place('2016-07-01/test-case')
Travis::Feierabend.deprecated('2016-07-01/test-case')
expect(Travis::Feierabend.get_refutations('2016-07-01/test-case').count).to be(1)
end
end
Expand Down

0 comments on commit ad9fe32

Please sign in to comment.