```ruby
module Texas
  module Build
    module Task
      class RewriteMarkedTemplates < Base
        def run
          build.ran_templates.select { |t| t.marked_for_rewrite? }.each do |t|
            t.write
          end
        end
      end
    end
  end
end
```

Fix bug in RewriteMarkedTemplates - only rewrite each marked template once
user
```ruby
module Texas
  module Build
    module Task
      class RewriteMarkedTemplates < Base
        def run
          templates.each { |t| t.write }
        end

        def templates
          build.ran_templates.uniq.select { |t| t.marked_for_rewrite? }
        end
      end
    end
  end
end
```
assistant