Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created spot to hold ENV variables with dotenv. Added ForecastIO gem and... #60

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .env
Empty file.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
/log/*
!/log/.keep
/tmp

my.env

2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gem 'pg'
gem 'rails_12factor'
gem 'rails_admin'
gem 'validates_formatting_of'
gem 'forecast_io'

platforms :ruby_18 do
gem 'fastercsv'
Expand All @@ -29,6 +30,7 @@ end

group :development, :test do
gem 'pry'
gem 'dotenv-rails'
end

group :production do
Expand Down
13 changes: 13 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,27 @@ GEM
thread_safe (~> 0.1)
warden (~> 1.2.3)
docile (1.1.5)
dotenv (1.0.2)
dotenv-rails (1.0.2)
dotenv (= 1.0.2)
erubis (2.7.0)
execjs (2.2.2)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
fastercsv (1.5.5)
font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0)
forecast_io (2.0.0)
faraday
hashie
multi_json
geokit (1.9.0)
multi_json (>= 1.3.2)
globalid (0.3.0)
activesupport (>= 4.1.0)
haml (4.0.6)
tilt
hashie (3.3.2)
hike (1.2.3)
http_accept_language (2.0.5)
i18n (0.7.0)
Expand All @@ -100,6 +110,7 @@ GEM
mini_portile (0.6.2)
minitest (5.5.1)
multi_json (1.10.1)
multipart-post (2.0.0)
nested_form (0.3.2)
netrc (0.10.2)
nokogiri (1.6.6.2)
Expand Down Expand Up @@ -232,7 +243,9 @@ DEPENDENCIES
arel
coveralls
devise
dotenv-rails
fastercsv
forecast_io
geokit
haml
http_accept_language
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ You can see a running version of the application at
This application requires [Postgres](http://www.postgresql.org/) to be installed

git clone git://github.com/codeforamerica/adopt-a-hydrant.git

_Note: if Git appears to hang or outright fails, try:_

git clone [email protected]:codeforamerica/adopt-a-hydrant.git

cd adopt-a-hydrant
bundle install

Expand Down
3 changes: 3 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require 'dotenv'
Dotenv.load '.env', 'my.env'

Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
3 changes: 3 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require 'dotenv'
Dotenv.load '.env', 'my.env'

Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
3 changes: 3 additions & 0 deletions config/initializers/forecast_io.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ForecastIO.configure do |configuration|
configuration.api_key = ENV['FORECAST_IO_API_KEY']
end
7 changes: 7 additions & 0 deletions my-template.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Template for my.env file

# Rename this file to .env, and set the envirionment variables to your specific values.
# This file will be ignored by Git, once renamed.


FORECAST_IO_API_KEY="Get a key from https://developer.forecast.io/"