Class: Fixme::Runner

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

Constant Summary collapse

RUN_ONLY_IN_THESE_FRAMEWORK_ENVS =
[ "", "test", "development" ]

Instance Method Summary collapse

Constructor Details

#initialize(date_and_message) ⇒ Runner

Returns a new instance of Runner.



49
50
51
# File 'lib/fixme.rb', line 49

def initialize(date_and_message)
  @date_and_message = date_and_message
end

Instance Method Details

#runObject



53
54
55
56
57
58
59
60
61
62
# File 'lib/fixme.rb', line 53

def run
  return if ENV["DISABLE_FIXME_LIB"]
  return unless RUN_ONLY_IN_THESE_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