Add a decorator named `sync`

I'm a crazy fan of DRY principle, so, I'm kind of sick of the `self.generate_to_file()` call that occurs again and again and again. What if we want to change the logic?

So, I wrote a small decorator that named `sync`, which wraps the last call. 

Hope you like it. :)