RubyGems Navigation menu

save_file 1.0.35

This class can be used to save a file in a convenient way, by giving you a very simple save-file functionality. I liked the name 'save_file()' a lot, and I found that I was needing such a functionality in many of my projects, so I made a tiny gem that would do exactly this. Note that the recommended methods are write_what_into() and append_what_into() - at the least for me, this is easy to remember. Of course you can use File.open() or File.new() already as-is in block variant, so there is no need to use a gem like this one here - but I did not want to have to deal with file permissions or missing files or similar all on my own, via the File API that I do not as easily remember. So I just wrote an API that is simple enough for my use cases. Usage examples: require 'save_file' save_what_into('test', '/tmp/test.txt') You can also use: SaveFile.write_what_into(what, into) SaveFile.append_what_into(what, into) The main module can be included into a class, which then will have these methods available. This project has no external dependencies, deliberately so. It has to remain stand-alone. Version 1.0.3 made it more clear when to use save_file() and when to use append_into_file().

Gemfile:
= Copier Copié!

installation:
=

Versions:

  1. 1.0.35 - November 11, 2023 (9 ko)
  2. 1.0.34 - September 15, 2021 (9 ko)
Voir toutes les versions (34)

Propriétaires:

Pushed by:

Auteurs:

  • Robert A. Heiler

Total de contrôle SHA 256:

e61cb7deb49593ccada64f7552ede16c9439ef6771a4c1f5fa10d0ea61fb1f19

Total de téléchargements 34 902

Pour cette version 471

License:

MIT

Version de Ruby requise: >= 2.7.6

Required Rubygems Version: >= 3.4.22

Liens: