rack-env 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -18
- data/lib/rack/env/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -2,13 +2,12 @@
|
|
2
2
|
[![Build Status](https://secure.travis-ci.org/banyan/rack-env.png)](http://travis-ci.org/banyan/rack-env)
|
3
3
|
[<img src="https://gemnasium.com/banyan/rack-env.png" />](https://gemnasium.com/banyan/rack-env)
|
4
4
|
|
5
|
-
|
5
|
+
Load environment variables from .env or specified file.
|
6
6
|
|
7
7
|
Some of the PaaS (such as [Heroku](http://www.heroku.com/) and [Sqale](http://sqale.jp)) are using configuration with .env.
|
8
8
|
|
9
9
|
This gem helps you while you are in development mode.
|
10
10
|
|
11
|
-
|
12
11
|
## Installation
|
13
12
|
|
14
13
|
Add this line to your application's Gemfile:
|
@@ -25,10 +24,6 @@ Or install it yourself as:
|
|
25
24
|
|
26
25
|
## Usage
|
27
26
|
|
28
|
-
```
|
29
|
-
require 'rack/env'
|
30
|
-
```
|
31
|
-
|
32
27
|
### Rails
|
33
28
|
|
34
29
|
```
|
@@ -37,24 +32,28 @@ group :development, :test do
|
|
37
32
|
end
|
38
33
|
```
|
39
34
|
|
40
|
-
### Rack
|
35
|
+
### Rack App (such as sinatra)
|
41
36
|
|
42
37
|
```
|
43
|
-
#
|
44
|
-
|
45
|
-
|
46
|
-
run MyApplication.new
|
47
|
-
end
|
38
|
+
# app.rb
|
39
|
+
require 'rack/env'
|
40
|
+
use Rack::Env
|
48
41
|
```
|
49
42
|
|
50
|
-
* Enable to
|
43
|
+
* Enable to specified file to load.
|
51
44
|
|
52
45
|
```
|
53
|
-
#
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
46
|
+
# app.rb
|
47
|
+
require 'rack/env'
|
48
|
+
use Rack::Env, envfile: 'somewhere/to/.env.development'
|
49
|
+
```
|
50
|
+
|
51
|
+
* Use only local development
|
52
|
+
|
53
|
+
```
|
54
|
+
# app.rb
|
55
|
+
require 'rack/env'
|
56
|
+
use Rack::Env if ENV['RACK_ENV'] != 'production'
|
58
57
|
```
|
59
58
|
|
60
59
|
## Contributing
|
@@ -64,3 +63,8 @@ end
|
|
64
63
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
65
64
|
4. Push to the branch (`git push origin my-new-feature`)
|
66
65
|
5. Create new Pull Request
|
66
|
+
|
67
|
+
|
68
|
+
## Copyright
|
69
|
+
|
70
|
+
Copyright (c) 2012 Kohei Hasegawa. See LICENSE for details.
|
data/lib/rack/env/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
segments:
|
116
116
|
- 0
|
117
|
-
hash: -
|
117
|
+
hash: -4307687027055974562
|
118
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
119
|
none: false
|
120
120
|
requirements:
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
segments:
|
125
125
|
- 0
|
126
|
-
hash: -
|
126
|
+
hash: -4307687027055974562
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
129
|
rubygems_version: 1.8.23
|