# Generated from dinosaur_catalog-2.0.gem by gem2rpm -*- rpm-spec -*- %global gem_name dinosaur_catalog Name: rubygem-%{gem_name} Version: 2.0 Release: 1%{?dist} Summary: Ruby program for the Dino Catalog Exercise as part of the Level Up Program License: MIT Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 2.0 BuildArch: noarch %description ## Dinosaur Catalog It may not be immediately evident, but I am a huge fan of dinosaurs. They're huge and dangerous and have cool names like Giganotosaurus (not to be confused with Gigantosaurus). ... Anyway. I need to catalog some dinosaurs for my newest project, DinoDex. I've got a CSV file for the dinosaur facts, and I need the code to read all the dinosaur facts and do some basic manipulations with the data. ### Requirements Go check out the CSVs and come back. Done? Cool, I've just got a few features I need: 1. I loaded my favorite dinosaurs into a CSV file you'll need to parse. I don't know a lot about African Dinosaurs though, so I downloaded one from The Pirate Bay. It isn't formatted as well as mine, but please try to parse it anyway. 2. I have friends who ask me a lot of questions about dinosaurs (I'm kind of a big deal). Please make sure the dinodex is able to answer these things for me: * Grab all the dinosaurs that were bipeds. * Grab all the dinosaurs that were carnivores (fish and insects count). * Grab dinosaurs for specific periods (no need to differentiate between Early and Late Cretaceous, btw). * Grab only big (> 2 tons) or small dinosaurs. * Just to be sure, I'd love to be able to combine criteria at will, even better if I can chain filter calls together. 3. For a given dino, I'd like to be able to print all the known facts about that dinosaur. If there are facts missing, please don't print empty values, just skip that heading. Make sure to print Early / Late etc for the periods. 4. Also, I'll probably want to print all the dinosaurs in a given collection (after filtering, etc). #### Extra Credit 1. I would love to have a way to do (and chain) generic search by parameters. I can pass in a hash, and I'd like to get the proper list of dinos back out. 2. CSV isn't may favorite format in the world. Can you implement a JSON export feature? Happy Hunting. (Giganotosaurus was the largest hunting dinosaur, at 46 feet long and up to 8 tons! Suh-weet.). %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}/ mkdir -p %{buildroot}%{_bindir} cp -a .%{_bindir}/* \ %{buildroot}%{_bindir}/ find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x %check pushd .%{gem_instdir} # Run the test suite. popd %files %dir %{gem_instdir} %{_bindir}/dinosaur_catalog %license %{gem_instdir}/LICENSE %{gem_instdir}/bin %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %doc %{gem_instdir}/README %changelog * Mon Apr 18 2022 mockbuilder - 2.0-1 - Initial package