Project

cease

0.0
No release in over a year
Cease is a tool that detects blocks of code to be removed at a specified time.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 5.3.2
~> 1.10.0
~> 3.0.0
~> 3.0.0
~> 2.0.4
 Project Readme

Cease

GitHub Actions

cease is a tool that scans for Ruby code marked as EOL.

Installation

Install via rubygems:

gem install cease

Usage

Run it:

cease [directory_or_source_file]*

Example

Basic usage

Given a source file called example.rb that contains the following code:

# [cease] at 12pm on 1/1/1999
class RemoveMeLater
  def foo
    puts 'bar'
  end
end
# [/cease]

You should see the output:

$ cease example.rb
Scanning 1 source(s)...

(example.rb)

  [3, 9]: Overdue by roughly 23 years
    class RemoveMeLater
      def foo
        puts 'bar'
      end
    end


Total of 1 evictions(s) found.

Options

Cease supports both 12 and 24 hour clocks:

# [cease] at 13:00 on 1/1/1999
class RemoveMeLater
...
# [/cease]

Multiple commands per source:

# [cease] at 12pm on 1/1/1999
class RemoveMeLater
  def foo
    puts 'bar'
  end
end
# [/cease]

# [cease] at 1pm on 3/3/3333
class RemoveMeWayLater
  def foo
    puts 'bar'
  end
end
# [/cease]

If a date isn't provided, Cease attempts to guess the date based on the git commit:

# [cease] at 13:00 # The date will be based on the commit timestamp of this comment.
class RemoveMeLater
...
# [/cease]

You can provide an optional timezone (defaults to UTC):

# [cease] at 1pm on 1/1/1999 { timezone: 'PST' }
class RemoveMeLater
...
# [/cease]

NOTE: Do not nest commands! This will not work:

# [cease] at 1pm
  class RemoveMe
    # [cease] at 3pm
    def initialize
    end
    # [/cease]
  end
# [/cease]

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DustyBitSoftware/cease. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Code of Conduct

Everyone interacting in the Cease project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.