lib/kicker/recipes/dot_kick.rb in kicker-2.1.0 vs lib/kicker/recipes/dot_kick.rb in kicker-2.2.0

- old
+ new

@@ -4,19 +4,25 @@ @features_before_dot_kick = $LOADED_FEATURES.dup @chains_before_dot_kick = Kicker.full_chain.map { |c| c.dup } end def call(files) - if files.delete('.kick') - reset! - load '.kick' - end + reset! if files.delete('.kick') end + def use? + File.exist?('.kick') + end + + def load! + load '.kick' + end + def reset! remove_loaded_features! reset_chains! + load! end def reset_chains! Kicker.full_chain = nil @@ -30,6 +36,12 @@ end end end end -process ReloadDotKick +if ReloadDotKick.use? + startup do + pre_process ReloadDotKick + ReloadDotKick.save_state + ReloadDotKick.load! + end +end \ No newline at end of file