Categories: None [Edit]
save_file
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().
Total
Ranking: - of 195,589
Downloads: -
Daily
Ranking: - of 195,564
Downloads: -
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
| Rank | Downloads | Name |
|---|---|---|
| 7,618 | 81,445 | yaml_to_rcfile_generator |
| 10,835 | 186,674 | dictionaries |
| 11,092 | 178,251 | multimedia_paradise |
| 13,926 | 36,992 | rcfile_generator |
| 17,930 | 26,316 | pipe_handler |
| 20,965 | 61,554 | pdf_paradise |
| 26,877 | 19,252 | vim_paradise |
| 27,528 | 20,023 | sql_paradise |
| 27,682 | 41,630 | image_paradise |
| 31,799 | 15,495 | magic_the_gathering |
| 36,452 | 28,832 | backup_paradise |
| 49,981 | 8,020 | menu_generator |
| 57,669 | 15,795 | generate_shell_completion |
| 61,498 | 6,158 | main_pdf |
| 75,320 | 5,527 | csv_paradise |
| 77,918 | 4,356 | generate_bash_tab_completion |
| 83,830 | 3,539 | create_ruby_directory_layout |
| 84,896 | 3,781 | add_inline_css |
| 85,096 | 3,280 | enable_autologin |
| 101,274 | 2,453 | generate_xorg_conf |
Depends on
| Rank | Downloads | Name |
|---|
Owners
| # | Gravatar | Handle |
|---|---|---|
| 1 | shevy |