README.md in elf_ham-0.1.0 vs README.md in elf_ham-0.2.0
- old
+ new
@@ -1,13 +1,67 @@
# ElfHam 🧝🍖
ElfHam is an extremely simple utility gem that's useful for transform CSVs.
-## Usage
+## tldr;
-```sh
-gem install elf_ham
+```ruby
+require "elf_ham"
+
+# Load your CSV:
+elf_ham = ElfHam.new(ARGF.read)
+
+# Filter rows:
+elf_ham.select { |row| row["header2"] != "b" }
+
+# Transform rows:
+elf_ham.transform do |row|
+ row["header3"] = "elfham"
+end
+
+# Print the result
+puts elf_ham.output
```
+
+## Instructions
+
+1. Install the gem:
+
+ ```sh
+ gem install elf_ham
+ ```
+
+2. Create a transformation script:
+
+ ```sh
+ echo '#!/usr/bin/env ruby
+
+ require "elf_ham"
+
+ puts ElfHam.new(ARGF.read).select do |row|
+ row["header2"] != "b"
+ end.transform do |row|
+ row["header3"] = "elfham"
+ end.output' > transform.rb
+ ```
+
+3. Make the script executable:
+
+ ```sh
+ chmod u+x transform.rb
+ ```
+
+4. Edit the script to your liking.
+
+5. Run it:
+
+ ```sh
+ transform.rb path/to/your.csv > transformed.csv
+
+ # or
+
+ cat path/to/your.csv | transform.rb > transformed.csv
+ ```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run
`rake spec` to run the tests. You can also run `bin/console` for an interactive