# Generated from save_file-1.0.33.gem by gem2rpm -*- rpm-spec -*- %global gem_name save_file Name: rubygem-%{gem_name} Version: 1.0.33 Release: 1%{?dist} Summary: 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() License: MIT URL: http://rubygems.org/gems/save_file Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem BuildRequires: ruby(release) BuildRequires: rubygems-devel >= 3.2.19 BuildRequires: ruby >= 2.7.3 BuildArch: noarch %description 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(). %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} %build # Create the gem as gem install only works on a gem file gem build ../%{gem_name}-%{version}.gemspec # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir # by default, so that we can move it into the buildroot in %%install %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ %check pushd .%{gem_instdir} # Run the test suite. popd %files %dir %{gem_instdir} %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %doc %{gem_instdir}/README.md %{gem_instdir}/save_file.gemspec %{gem_instdir}/test %changelog * Wed Aug 25 2021 mockbuilder - 1.0.33-1 - Initial package