This project contains a simple class to aid in parsing CSV formatted data from a string to generate new filenames for the referenced image files.
- A current version of Ruby installed & available. (Tested with 3.2.2 & 2.7.8)
-
Clone the repository:
git clone https://github.com/kylebowen/heartland-photos.git
-
Navigate to the project directory:
cd heartland-photos
-
Install dependencies:
bundle install
-
Run the specs:
bundle exec rspec spec/
-
Open IRB while sourcing the PhotoListConverter class:
irb -r "./lib/photo_list_converter.rb"
-
Create a new instance of the PhotoListConverter class:
converter = PhotoListConverter.new
-
Import the string containing your CSV list:
list = File.read("sample_list.txt")
-
Process the list with the converter:
new_names = converter.process(list)
-
Display the list of new filenames:
print new_names
-
(Optional) Save the list of new filenames to a text file:
File.write("my_new_filename.txt", new_names)