Sha256: cfdc40decb62eec341f7b06796e623d9a182a4fe35b271930ad3109ceba11e1b

Contents?: true

Size: 780 Bytes

Versions: 13

Compression:

Stored size: 780 Bytes

Contents

def followable?
  false
end

def history?
  false
end

format do
  view :not_found do |args|
    if update_machine_output_live?
      Card::Cache.reset_all # FIXME: wow, this is overkill, no?
      root.error_status = 302
      card.left.update_machine_output
      card_path card.left.machine_output_url
    else
      super args
    end
  end

  def update_machine_output_live?
    case
    when !card.left.is_a?(Machine) then false # must be a machine
    when card.left.locked?         then false # machine must not be running
    when card.new_card?            then true  # always update if new
    else
      # must want current output (won't re-output old stuff)
      (selected_id = card.selected_action_id) &&
        selected_id == card.last_action_id
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
card-1.19.0 mod/machines/set/right/machine_output.rb
card-1.18.6 mod/03_machines/set/right/machine_output.rb
card-1.18.5 mod/03_machines/set/right/machine_output.rb
card-1.18.4 mod/03_machines/set/right/machine_output.rb
card-1.18.3 mod/03_machines/set/right/machine_output.rb
card-1.18.2 mod/03_machines/set/right/machine_output.rb
card-1.18.1 mod/03_machines/set/right/machine_output.rb
card-1.18.0 mod/03_machines/set/right/machine_output.rb
card-1.17.4 mod/03_machines/set/right/machine_output.rb
card-1.17.3 mod/03_machines/set/right/machine_output.rb
card-1.17.2 mod/03_machines/set/right/machine_output.rb
card-1.17.1 mod/03_machines/set/right/machine_output.rb
card-1.17.0 mod/03_machines/set/right/machine_output.rb