dotenv 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9e86533dc0be0761ac61ea33755fc7a717790e4
4
- data.tar.gz: bb416f9f7c9bd513aeef7e7ec10c08fe3605bc0a
3
+ metadata.gz: 39a2b727e06c9a55620194609c240d04c7e94649
4
+ data.tar.gz: f1e22eac1b800ed26cb8f3c02afbe3fb54c73bdc
5
5
  SHA512:
6
- metadata.gz: ad361abae6d86e24262cab7cc5a2ab7a18e3bf43dbd2a923eecf39f56a1bcd3d7292cb6e2be336486106ea7497c044d1ebed155350c0220e2a794db8e404a408
7
- data.tar.gz: 04068ddc413f631ec3daa24b8e8185bdce861b1d1c49e7507ccb6ee598ebc04df86c59fcc400ac90141df8b60c406dfabbede72252424f8e5a33cec49463bf11
6
+ metadata.gz: eb5f26934458e39686244acc86cdc47ad3549a8c47527cb5382a4177225e9995decd0d7930c459a4cc48bc63150e3667cc069578a4205b5d8ea150739599008a
7
+ data.tar.gz: 7076bf1cd763d703c291de86a01919826df5c73d5c6ddf79d248f29c392f994e25586f6276ea73fc89c52f2c4cccfd441579bd3613229fee20dc60d181711bce
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # dotenv [![Build Status](https://secure.travis-ci.org/bkeepers/dotenv.png?branch=master)](https://travis-ci.org/bkeepers/dotenv)
2
2
 
3
+ [![Join the chat at https://gitter.im/bkeepers/dotenv](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bkeepers/dotenv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
+
3
5
  Shim to load environment variables from `.env` into `ENV` in *development*.
4
6
 
5
7
  Storing [configuration in the environment](http://www.12factor.net/config) is one of the tenets of a [twelve-factor app](http://www.12factor.net/). Anything that is likely to change between deployment environments–such as resource handles for databases or credentials for external services–should be extracted from the code into environment variables.
@@ -117,7 +119,9 @@ dotenv was originally created to load configuration variables into `ENV` in *dev
117
119
 
118
120
  However, some find dotenv to be a convenient way to configure Rails applications in staging and production environments, and you can do that by defining environment-specific files like `.env.production` or `.env.test`.
119
121
 
120
- You can also `.env.local` for local overrides.
122
+ You can also use `.env.local` for local overrides.
123
+
124
+ If you use this gem to handle env vars for multiple Rails environments (development, test, production, etc.), please note that env vars that are general to all environments should be stored in `.env`. Then, environment specific env vars should be stored in `.env.<that environment's name>`. When you load a certain environment, dotenv will first load general env vars from `.env`, then load environment specific env vars from `.env.<current environment>`. Variables defined in `.env.<current environment>` will override any values set in `.env` or already defined in the environment.
121
125
 
122
126
  ## Should I commit my .env file?
123
127
 
@@ -41,7 +41,7 @@ module Dotenv
41
41
  end
42
42
 
43
43
  def call
44
- @string.split("\n").each do |line|
44
+ @string.split(/[\n\r]+/).each do |line|
45
45
  parse_line(line)
46
46
  end
47
47
  @hash
@@ -83,7 +83,7 @@ module Dotenv
83
83
  end
84
84
 
85
85
  def expand_newlines(value)
86
- value.gsub('\n', "\n")
86
+ value.gsub('\n', "\n").gsub('\r', "\r")
87
87
  end
88
88
 
89
89
  def variable_not_set?(line)
@@ -1,3 +1,3 @@
1
1
  module Dotenv
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-03 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.2.2
94
+ rubygems_version: 2.2.3
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Loads environment variables from `.env`.