dot_env 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +48 -0
- data/Rakefile +14 -0
- data/dot_env.gemspec +25 -0
- data/lib/dot_env.rb +43 -0
- data/lib/dot_env/environment.rb +54 -0
- data/lib/dot_env/parser.rb +46 -0
- data/lib/dot_env/version.rb +3 -0
- data/spec/dot_env_spec.rb +43 -0
- data/spec/dotenv/environment_spec.rb +114 -0
- data/spec/dotenv/parser_spec.rb +44 -0
- data/spec/fixtures/dotenv/testenv +12 -0
- data/spec/test_helper.rb +14 -0
- metadata +120 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4f007f4a0f032b2fc3e54499c7af7788ed2172d6
|
4
|
+
data.tar.gz: 6d6e6f77239cd6299365547b993400b24ba358ab
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b691e2b0ef4baad4049b2c48546ece7a593e7fe8f6a8fe397a28146cb4378a0dec6e3443eaee4d5a84e8b8e4f42cf0e107eed242fb960073cb512dff845c9239
|
7
|
+
data.tar.gz: 1f58772ad5fae4469b696545b99c5d0de58c3e61ba58359c5162f9f95c26a3dfde3917a33720af3198c650f23dfa0b8ce1b89f6d87b2bdebbd916f7997234184
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 zsolt kormany
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# DotEnv
|
2
|
+
|
3
|
+
`DotEnv` is for managing different environment setups based on a simple textfile.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'dot_env', github: 'kaze/dot_env'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
Basic usage:
|
18
|
+
|
19
|
+
require 'dot_env'
|
20
|
+
|
21
|
+
current_environment = DotEnv.get_environment #=> 'development'
|
22
|
+
|
23
|
+
The `DotEnv.get_environment` method reads a file (named `.env` as default). It reads, parses and sets all the environment variables found in this file. After that you can access these variables in your application simply using `ENV['VARIABLE_NAME']`.
|
24
|
+
|
25
|
+
If it doesn't find an `.env` file in your app's root directory, then sets the name of the environment -- as default -- to `development`.
|
26
|
+
|
27
|
+
I made assumption only about naming one variable, and this is `'APP_ENV'`. `DotEnv` tries to detect the current environment's name from this setting.
|
28
|
+
|
29
|
+
You can use any other name for your settings file, and you can add that name as a parameter to the function: `DotEnv.get_environment('path/to/settings_file')`
|
30
|
+
|
31
|
+
`DotEnv` handles the variables as below:
|
32
|
+
|
33
|
+
- accepts shell-compatible variable names
|
34
|
+
- values could be quoted or unquoted
|
35
|
+
- supports basic shell variable expansion (`$VARIABLE` and `${VARIABLE}`)
|
36
|
+
- handles simple arrays
|
37
|
+
- handles boolean values (`true, yes, 1` will be `true` and `false, no, 0` will be `false`, case insensitively)
|
38
|
+
|
39
|
+
After parsing every variable's type will be `string`, except booleans and arrays.
|
40
|
+
|
41
|
+
|
42
|
+
## Contributing
|
43
|
+
|
44
|
+
1. Fork it ( https://github.com/kaze/dot_env/fork )
|
45
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
46
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
47
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
48
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/testtask'
|
3
|
+
|
4
|
+
Rake::TestTask.new do |t|
|
5
|
+
t.pattern = 'spec/**/*_spec.rb'
|
6
|
+
end
|
7
|
+
|
8
|
+
task :default => :test
|
9
|
+
|
10
|
+
desc 'Generates a coverage report'
|
11
|
+
task :coverage do
|
12
|
+
ENV['COVERAGE'] = 'true'
|
13
|
+
Rake::Task['test'].execute
|
14
|
+
end
|
data/dot_env.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'dot_env/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "dot_env"
|
8
|
+
spec.version = DotEnv::VERSION
|
9
|
+
spec.authors = ["zsolt kormany"]
|
10
|
+
spec.email = ["zsoltkormany@gmail.com"]
|
11
|
+
spec.summary = %q{dotenv manages your environment settings}
|
12
|
+
spec.description = %q{dotenv manages your environment settings}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.3"
|
23
|
+
spec.add_development_dependency "minitest-reporters", "~> 1.0"
|
24
|
+
spec.add_development_dependency "simplecov", "~> 0.8"
|
25
|
+
end
|
data/lib/dot_env.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require "dot_env/version"
|
2
|
+
require 'logger'
|
3
|
+
require_relative 'dot_env/parser'
|
4
|
+
require_relative 'dot_env/environment'
|
5
|
+
|
6
|
+
module DotEnv
|
7
|
+
@log = Logger.new($stdout)
|
8
|
+
@log.level = Logger::DEBUG
|
9
|
+
@parser = DotEnv::Parser
|
10
|
+
@env = DotEnv::Environment.new(@parser, ARGV)
|
11
|
+
@env_file = @env.fetch('ENVIRONMENT_SETTINGS_FILE', '.env')
|
12
|
+
|
13
|
+
def self.read_env_file(filepath)
|
14
|
+
File.open(filepath).each do |line|
|
15
|
+
unless line.strip.empty? or line.strip.start_with?('#')
|
16
|
+
key, value = @parser.get_value_pair(line.strip)
|
17
|
+
@env.set(key, value)
|
18
|
+
end
|
19
|
+
end.close()
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.set_default_env(filepath)
|
23
|
+
current_env = @env.get_current
|
24
|
+
# @log.info "Environment settings file ('#{filepath}') not found."
|
25
|
+
# @log.info "Setting up #{current_env} environment."
|
26
|
+
@env.set_current(current_env)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.set_environment(filepath)
|
30
|
+
self.read_env_file(filepath)
|
31
|
+
current_env = @env.get_current
|
32
|
+
# @log.info "Environment settings file ('#{filepath}') found."
|
33
|
+
# @log.info "Setting up #{current_env} environment."
|
34
|
+
rescue Errno::ENOENT
|
35
|
+
self.set_default_env(filepath)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.get_environment(filepath=nil)
|
39
|
+
filepath ||= @env_file
|
40
|
+
self.set_environment(filepath)
|
41
|
+
@env.get_current
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module DotEnv
|
2
|
+
class Environment
|
3
|
+
attr_accessor :cmdline_args,
|
4
|
+
:test_runner_words,
|
5
|
+
:test_file_words
|
6
|
+
|
7
|
+
def initialize(parser, command_line_args)
|
8
|
+
@parser = parser
|
9
|
+
@cmdline_args = command_line_args
|
10
|
+
@test_runner_words = ['spec', 'rspec', 'cucumber']
|
11
|
+
@test_file_words = ['test', 'spec', 'feature']
|
12
|
+
end
|
13
|
+
|
14
|
+
def fetch(key, default=nil)
|
15
|
+
value = ENV.fetch(key, default)
|
16
|
+
value = @parser.parse(value) unless value.nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
def set(key, value)
|
20
|
+
ENV[key] = value
|
21
|
+
end
|
22
|
+
|
23
|
+
def check_test_runner
|
24
|
+
@test_runner_words.each do |word|
|
25
|
+
return 'testing' if @cmdline_args.include? word
|
26
|
+
end
|
27
|
+
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
31
|
+
def check_test_file(argword)
|
32
|
+
@test_file_words.each do |word|
|
33
|
+
return 'testing' if argword.include? word
|
34
|
+
end
|
35
|
+
|
36
|
+
nil
|
37
|
+
end
|
38
|
+
|
39
|
+
def check_if_testing
|
40
|
+
test_runner = check_test_runner
|
41
|
+
test_file = nil
|
42
|
+
@cmdline_args.each { |a| test_file = check_test_file(a) if test_file.nil? }
|
43
|
+
current_env = test_runner || test_file
|
44
|
+
end
|
45
|
+
|
46
|
+
def set_current(env)
|
47
|
+
set('APP_ENV', env)
|
48
|
+
end
|
49
|
+
|
50
|
+
def get_current
|
51
|
+
check_if_testing || fetch('APP_ENV', 'development')
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module DotEnv
|
2
|
+
module Parser
|
3
|
+
TRUEWORDS = ['true', 'yes', '1']
|
4
|
+
FALSEWORDS = ['false', 'no', '0']
|
5
|
+
|
6
|
+
def self.get_value_pair(line)
|
7
|
+
return line.chomp.split('=').each {|v| v.gsub!(/['"]/, '') }.each(&:strip!)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.cleanup(value)
|
11
|
+
value.gsub(/["'\[\]]/, '').split(',').each(&:strip!)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.expand(value)
|
15
|
+
value.gsub!(/\$\{?(\w+)\}?/) { ENV.fetch($1, nil) } || value
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.check_truthy(value)
|
19
|
+
if TRUEWORDS.include? value.to_s.downcase
|
20
|
+
return true
|
21
|
+
else
|
22
|
+
return value
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.check_falsy(value)
|
27
|
+
if FALSEWORDS.include? value.to_s.downcase
|
28
|
+
return false
|
29
|
+
else
|
30
|
+
return value
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.parse(value)
|
35
|
+
parsed = []
|
36
|
+
self.cleanup(value).each do |v|
|
37
|
+
v = self.expand(v)
|
38
|
+
v = self.check_truthy(v)
|
39
|
+
v = self.check_falsy(v)
|
40
|
+
parsed.push v
|
41
|
+
end
|
42
|
+
|
43
|
+
parsed.length > 1 ? parsed : parsed.first
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'logger'
|
2
|
+
require_relative 'test_helper'
|
3
|
+
require_relative '../lib/dot_env'
|
4
|
+
|
5
|
+
describe DotEnv do
|
6
|
+
before { ENV['APP_ENV'] = nil }
|
7
|
+
|
8
|
+
describe "set_environment" do
|
9
|
+
describe "the happy path" do
|
10
|
+
let(:env) { DotEnv::Environment.new(DotEnv::Parser, ARGV) }
|
11
|
+
|
12
|
+
before do
|
13
|
+
DotEnv.set_environment('spec/fixtures/dotenv/testenv')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "reads the given environment settings file and sets the environment" do
|
17
|
+
ENV['APP_NAME'].must_equal 'testapp'
|
18
|
+
ENV['AN_ARRAY'].must_equal '[egy, ketto, harom]'
|
19
|
+
ENV['UNBELIEVABLE'].must_equal 'True'
|
20
|
+
ENV['SOMEWHERE'].must_equal '$HOME'
|
21
|
+
end
|
22
|
+
|
23
|
+
it "can read back those settings" do
|
24
|
+
env.fetch('APP_NAME').must_equal 'testapp'
|
25
|
+
env.fetch('AN_ARRAY').must_equal ['egy', 'ketto', 'harom']
|
26
|
+
env.fetch('UNBELIEVABLE').must_equal true
|
27
|
+
env.fetch('SOMEWHERE').must_equal ENV['HOME']
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "when there is no environment setting file found" do
|
32
|
+
it "must return 'development' environment" do
|
33
|
+
DotEnv.set_environment('path/to/nonexisting/file').must_equal 'development'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "get_environment" do
|
39
|
+
it "returns the environment's name after set up" do
|
40
|
+
DotEnv.get_environment('spec/fixtures/dotenv/testenv').must_equal 'staging'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
require_relative '../../lib/dot_env/parser'
|
3
|
+
require_relative '../../lib/dot_env/environment'
|
4
|
+
|
5
|
+
describe DotEnv::Environment do
|
6
|
+
let(:env) { DotEnv::Environment.new(DotEnv::Parser, ARGV) }
|
7
|
+
|
8
|
+
before do
|
9
|
+
ENV['THE_MEANING_OF_LIFE'] = '42'
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "fetch" do
|
13
|
+
it "reads environment variables" do
|
14
|
+
env.fetch('THE_MEANING_OF_LIFE').must_equal '42'
|
15
|
+
end
|
16
|
+
|
17
|
+
it "reads environment variables with defaults" do
|
18
|
+
env.fetch('THE_MEANING_OF_LIFE', 'hello').must_equal '42'
|
19
|
+
end
|
20
|
+
|
21
|
+
it "uses default if there is no such variable" do
|
22
|
+
env.fetch('NONEXISTINGVARIABLE', 'hello').must_equal 'hello'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "check_test_runner" do
|
27
|
+
it "returns 'testing' when rspec runs" do
|
28
|
+
env.cmdline_args = ['spec']
|
29
|
+
|
30
|
+
env.check_test_runner.must_equal 'testing'
|
31
|
+
end
|
32
|
+
|
33
|
+
it "returns 'testing' when cucumber runs" do
|
34
|
+
env.cmdline_args = ['cucumber']
|
35
|
+
|
36
|
+
env.check_test_runner.must_equal 'testing'
|
37
|
+
end
|
38
|
+
|
39
|
+
it "returns nil when no test runs" do
|
40
|
+
env.cmdline_args = []
|
41
|
+
|
42
|
+
env.check_test_runner.must_equal nil
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "check_test_file" do
|
47
|
+
it "returns 'testing' when a spec file runs" do
|
48
|
+
argword = 'path/to/something_spec.rb'
|
49
|
+
|
50
|
+
env.check_test_file(argword).must_equal 'testing'
|
51
|
+
end
|
52
|
+
|
53
|
+
it "returns 'testing' when cucumber runs" do
|
54
|
+
argword = 'path/to/something.feature'
|
55
|
+
|
56
|
+
env.check_test_file(argword).must_equal 'testing'
|
57
|
+
end
|
58
|
+
|
59
|
+
it "returns nil when no test runs" do
|
60
|
+
argword = ''
|
61
|
+
|
62
|
+
env.check_test_file(argword).must_equal nil
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe "check_if_testing" do
|
67
|
+
it "returns 'testing' when there is a testfile in the arguments" do
|
68
|
+
env.cmdline_args = ['ruby', 'path/to/test_file.rb']
|
69
|
+
|
70
|
+
env.check_if_testing.must_equal 'testing'
|
71
|
+
end
|
72
|
+
|
73
|
+
it "returns nil when no test runs" do
|
74
|
+
env.cmdline_args = []
|
75
|
+
|
76
|
+
env.check_if_testing.must_equal nil
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
it "sets the current environment" do
|
81
|
+
ENV['APP_ENV'] = 'nothing'
|
82
|
+
env.set_current('strange')
|
83
|
+
|
84
|
+
ENV['APP_ENV'].must_equal 'strange'
|
85
|
+
end
|
86
|
+
|
87
|
+
describe "get_current_env" do
|
88
|
+
it "returns 'testing' when there is a testfile in the arguments" do
|
89
|
+
env.cmdline_args = ['ruby', 'path/to/test_file.rb']
|
90
|
+
|
91
|
+
env.get_current.must_equal 'testing'
|
92
|
+
end
|
93
|
+
|
94
|
+
it "returns 'testing' when a test runner runs" do
|
95
|
+
env.cmdline_args = ['cucumber']
|
96
|
+
|
97
|
+
env.get_current.must_equal 'testing'
|
98
|
+
end
|
99
|
+
|
100
|
+
it "returns 'dev' when there are no tests, but the APP_ENV is 'dev'" do
|
101
|
+
ENV['APP_ENV'] = 'dev'
|
102
|
+
env.cmdline_args = []
|
103
|
+
|
104
|
+
env.get_current.must_equal 'dev'
|
105
|
+
end
|
106
|
+
|
107
|
+
it "returns 'development' otherwise" do
|
108
|
+
ENV['APP_ENV'] = nil
|
109
|
+
env.cmdline_args = []
|
110
|
+
|
111
|
+
env.get_current.must_equal 'development'
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
require_relative '../../lib/dot_env/parser'
|
3
|
+
|
4
|
+
describe DotEnv::Parser do
|
5
|
+
let(:parser) { DotEnv::Parser }
|
6
|
+
|
7
|
+
before do
|
8
|
+
ENV['THE_MEANING_OF_LIFE'] = '42'
|
9
|
+
end
|
10
|
+
|
11
|
+
it "gets key-value pairs from lines" do
|
12
|
+
line = " something = ' some other thing '"
|
13
|
+
|
14
|
+
parser.get_value_pair(line).must_equal ["something", "some other thing"]
|
15
|
+
end
|
16
|
+
|
17
|
+
it "expands environment variables" do
|
18
|
+
parser.expand("$THE_MEANING_OF_LIFE").must_equal '42'
|
19
|
+
end
|
20
|
+
|
21
|
+
it "cleans up variables" do
|
22
|
+
value = '["spec", "rspec", "test", "cucumber", $HOME]'
|
23
|
+
result = ["spec", "rspec", "test", "cucumber", "$HOME"]
|
24
|
+
|
25
|
+
parser.cleanup(value).must_equal result
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "parse" do
|
29
|
+
it "handles arrays" do
|
30
|
+
value = '["spec", "rspec", "test", "cucumber", $HOME, FALSE]'
|
31
|
+
result = ["spec", "rspec", "test", "cucumber", ENV['HOME'], false]
|
32
|
+
|
33
|
+
parser.parse(value).must_equal result
|
34
|
+
end
|
35
|
+
|
36
|
+
it "handles booleans" do
|
37
|
+
parser.parse("True").must_equal true
|
38
|
+
end
|
39
|
+
|
40
|
+
it "handles expandable variables" do
|
41
|
+
parser.parse("$HOME").must_equal ENV['HOME']
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/spec/test_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
app_root = File.realpath(File.join(File.dirname(__FILE__), '..'))
|
2
|
+
$:.unshift app_root unless $LOAD_PATH.include? app_root
|
3
|
+
|
4
|
+
if ENV['COVERAGE']
|
5
|
+
require 'simplecov'
|
6
|
+
SimpleCov.start do
|
7
|
+
add_filter 'test'
|
8
|
+
command_name 'Minitest'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'minitest/reporters'
|
13
|
+
Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new)
|
14
|
+
require 'minitest/autorun'
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dot_env
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- zsolt kormany
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest-reporters
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.8'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.8'
|
69
|
+
description: dotenv manages your environment settings
|
70
|
+
email:
|
71
|
+
- zsoltkormany@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- dot_env.gemspec
|
82
|
+
- lib/dot_env.rb
|
83
|
+
- lib/dot_env/environment.rb
|
84
|
+
- lib/dot_env/parser.rb
|
85
|
+
- lib/dot_env/version.rb
|
86
|
+
- spec/dot_env_spec.rb
|
87
|
+
- spec/dotenv/environment_spec.rb
|
88
|
+
- spec/dotenv/parser_spec.rb
|
89
|
+
- spec/fixtures/dotenv/testenv
|
90
|
+
- spec/test_helper.rb
|
91
|
+
homepage: ''
|
92
|
+
licenses:
|
93
|
+
- MIT
|
94
|
+
metadata: {}
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
requirements: []
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 2.2.2
|
112
|
+
signing_key:
|
113
|
+
specification_version: 4
|
114
|
+
summary: dotenv manages your environment settings
|
115
|
+
test_files:
|
116
|
+
- spec/dot_env_spec.rb
|
117
|
+
- spec/dotenv/environment_spec.rb
|
118
|
+
- spec/dotenv/parser_spec.rb
|
119
|
+
- spec/fixtures/dotenv/testenv
|
120
|
+
- spec/test_helper.rb
|