zigomir / sheet_loader

Google Spreadsheet to Middleman YAML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SheetLoader

Elixir program that polls Google Spreadsheet and serializes it into YAML file on disk.

Each spreadsheet tab will be saved as different YAML file.

It's based on GoogleSheets library.

Before you begin you'll need to give your Spreadsheet public read access.

Setup & development

Edit config/config.exs.

Run mix gs.fetch to set up initial CSV files.

iex -S mix

Testing

mix test --no-start

Running in production

Be sure to run mix gs.fetch before mix run to set up initial CSV files.

cp config/dev.exs config/prod.exs # edit your prod.exs config file
mix gs.fetch && MIX_ENV=prod mix run --no-halt

Learned

worker.ex is our GenServer. Every GenServer needs to implement start_link. start_link is called when creating workers in Supervisor.

--no-halt is what I needed from the start. (http://stackoverflow.com/questions/30687781/how-to-run-elixir-application)

:timer.sleep(poll_delay_seconds * 5 * 1000) # This timer needs to always be more than poll_delay_seconds

To skip IEx.pry write down respawn inside IEx session.

About

Google Spreadsheet to Middleman YAML


Languages

Language:Elixir 100.0%