Minor improvements

Minor improvements

  • force focus on guard
  • comment to explain next_run
diff --git a/Guardfile b/Guardfile
index b53060f..75d88ab 100644
--- a/Guardfile
+++ b/Guardfile
@@ -24,7 +24,7 @@
 #  * zeus: 'zeus rspec' (requires the server to be started separately)
 #  * 'just' rspec: 'rspec'
 
-guard :rspec, cmd: "bundle exec rspec" do
+guard :rspec, cmd: "bundle exec rspec", failed_mode: :focus do
   require "guard/rspec/dsl"
   dsl = Guard::RSpec::Dsl.new(self)
 
diff --git a/lib/mini_scheduler/schedule_info.rb b/lib/mini_scheduler/schedule_info.rb
index 9e12875..7d651d9 100644
--- a/lib/mini_scheduler/schedule_info.rb
+++ b/lib/mini_scheduler/schedule_info.rb
@@ -58,6 +58,9 @@ module MiniScheduler
         @next_run = @prev_run + mixup + @klass.every
       end
 
+      # this can look a bit confusing, but @next_run above could be off
+      # if prev_run is off, so this ensures it ends up correct and in the
+      # future
       if !valid?
         @next_run = Time.now.to_i + 300 * Random.rand
       end
@@ -90,7 +93,6 @@ module MiniScheduler
     end
 
     def write!
-
       clear!
       redis.set key, {
         next_run: @next_run,

GitHub sha: 3e4aa682