RubyGems Navigation menu

save_file 1.0.28

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(). If you have specific suggestions to make this gem more useful for others, please drop me an email at: shevegen@gmail.com Thank you.

Versions:

  1. 1.0.28 - October 26, 2018 (9 KB)
  2. 1.0.27 - July 06, 2018 (9 KB)
  3. 1.0.26 - July 26, 2017 (9 KB)
  4. 1.0.25 - July 03, 2017 (8.5 KB)
  5. 1.0.24 - July 02, 2017 (8.5 KB)
Show all versions (27 total)

Authors:

  • Robert A. Heiler

Owners:

SHA 256 checksum:

0fbebbf282cac1bc06dfbac90e119c8533fc077055d0c3609112faee4bb0de72

Total downloads 25,310

For this version 190

Gemfile:
= Copy to clipboard Copied!

install:
=

License:

GPL-2.0

Required Ruby Version: >= 2.5.3

Required Rubygems Version: >= 2.7.6

Links: