Skip to content

cirlabs/amzn-injuries-app

Repository files navigation

CIR Amazon FulFillment centers map

Development

Prerequisites

If you're new to Ruby

Use rbenv to manage Ruby versions.
  • If you need to install rbenv on MacOS, installation with Homebrew is easiest. Make sure you follow the directions to set up rbenv in your shell.
Installing Ruby
  • Middleman
gem install middleman
  • Yarn
brew install yarn

Setup

After installing prerequisites, run the following commands at the root of the project

bundle install
yarn install

Running the project

Run

bundle exec foreman start

Open http://localhost:4567

Deploying the project

First build a static version of the project using the following command

bundle exec middleman build

Now copy contents of ./build folder to the amazon S3 bucket.

PS: If you have developer access keys, you can add a ∏rake task to automate this.

Updating data

Because of a breaking change in Google Drive and Sheets API, the data update process includes manual steps at the moment.

  1. Manually update data/amazon.json file Convert contents of the Google Sheet to json using a CSV to JSON converter such as csv2json

The json output should be a hash where the facility codes are the keys and each row is an array attached to the key. See data\amazon.json for reference

  1. Remove / from key names To prevent processing errors, rename

(Injury Rate)/(5.2, Industry Injury Rate)

to

(Injury Rate)(5.2, Industry Injury Rate)

and

(Serious Injury Rate)/(4, Industry Serious Injury Rate for 2018)

to

(Serious Injury Rate)(4, Industry Serious Injury Rate for 2018)

  1. Run script to process data Run bundle exec ruby ./scripts/process_data.rb

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •