Class: Fixme::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/fixme.rb

Constant Summary collapse

RUN_ONLY_IN_FRAMEWORK_ENVS =
[ "", "test", "development" ]

Instance Method Summary collapse

Constructor Details

#initialize(date_and_message) ⇒ Runner

Returns a new instance of Runner.



37
38
39
# File 'lib/fixme.rb', line 37

def initialize(date_and_message)
  @date_and_message = date_and_message
end

Instance Method Details

#runObject



41
42
43
44
45
46
47
48
49
50
# File 'lib/fixme.rb', line 41

def run
  return if ENV["DISABLE_FIXME_LIB"]
  return unless RUN_ONLY_IN_FRAMEWORK_ENVS.include?(framework_env.to_s)

  due_date, message = parse

  disallow_timecop do
    Fixme.explode(due_date, message) if Date.today >= due_date
  end
end