Categories: None [Edit]

save_file

https://rubygems.org/gems/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: -

Depended by

RankDownloadsName
7,61881,445yaml_to_rcfile_generator
10,835186,674dictionaries
11,092178,251multimedia_paradise
13,92636,992rcfile_generator
17,93026,316pipe_handler
20,96561,554pdf_paradise
26,87719,252vim_paradise
27,52820,023sql_paradise
27,68241,630image_paradise
31,79915,495magic_the_gathering
36,45228,832backup_paradise
49,9818,020menu_generator
57,66915,795generate_shell_completion
61,4986,158main_pdf
75,3205,527csv_paradise
77,9184,356generate_bash_tab_completion
83,8303,539create_ruby_directory_layout
84,8963,781add_inline_css
85,0963,280enable_autologin
101,2742,453generate_xorg_conf

Depends on

RankDownloadsName

Owners

#GravatarHandle
1iconshevy