environmenter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/Appraisals +11 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +58 -0
- data/Rakefile +2 -0
- data/environmenter.gemspec +27 -0
- data/gemfiles/rails_3.gemfile +7 -0
- data/gemfiles/rails_3.gemfile.lock +126 -0
- data/gemfiles/rails_4.gemfile +7 -0
- data/gemfiles/rails_4.gemfile.lock +141 -0
- data/gemfiles/rails_none.gemfile +5 -0
- data/gemfiles/rails_none.gemfile.lock +51 -0
- data/lib/environmenter.rb +5 -0
- data/lib/environmenter/loader.rb +61 -0
- data/lib/environmenter/version.rb +3 -0
- metadata +132 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 90a4e8da23d76d88c3c82b5b9fb8edb2f8404d75
|
4
|
+
data.tar.gz: 2dfc20199e568b8bc02db4e9f4837244b543de27
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a0347c8729b16808a916efd7c6a79a165a3cbbe69e931c34a4f26f7c33b650f25364c3ecf6d213706521b83aa94e7f626001fdf1437052aec5041aae719b1bf9
|
7
|
+
data.tar.gz: 32a7375f8f3a98e364f7846dc2aeed0be9ddb2116be15a46d61292eac09e9faad612d1f7d8a7e40bb280362e1f5be005d5e67b0a610312fe5614e691ed5b98d4
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Appraisals
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at sax@livinginthepast.org. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Eric Saxby
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
Environmenter
|
2
|
+
=============
|
3
|
+
|
4
|
+
Optionally load a Rails environment from other code. Processes which implement custom event loops may
|
5
|
+
wish to load Rails, for instance, to automatically configure database connections and provide access
|
6
|
+
to models.
|
7
|
+
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
The basic usage instantiates an environmenter and loads it:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'environmenter'
|
15
|
+
Environmenter::Loader.new.load!
|
16
|
+
```
|
17
|
+
|
18
|
+
In some cases one might wish to manually require other files in the load path:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'environmenter'
|
22
|
+
|
23
|
+
config = {require: ['path/to/file']}
|
24
|
+
config = {'require' => ['path/to/file']}
|
25
|
+
config = OpenStruct.new(require: ['path/to/file'])
|
26
|
+
|
27
|
+
Environmenter::Loader.new(config).load!
|
28
|
+
```
|
29
|
+
|
30
|
+
Environmenter will not explode if Rails does not exist in the load path. It will attempt several different
|
31
|
+
methods of loading Rails, to support versions > 3.0.
|
32
|
+
|
33
|
+
|
34
|
+
## Contributing
|
35
|
+
|
36
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/environmenter. This project is
|
37
|
+
ntended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
|
38
|
+
the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
39
|
+
|
40
|
+
If attempting to load a version of Rails newer than that supported by this gem, please file an issue. Pull requests
|
41
|
+
are welcome, though note that the gem owner is picky about formatting and may ask for revisions. New features may
|
42
|
+
not be accepted, in a desire to keep this gem small with no external dependencies. This gem should only do one thing,
|
43
|
+
hopefully doing it well.
|
44
|
+
|
45
|
+
|
46
|
+
## Tests
|
47
|
+
|
48
|
+
```bash
|
49
|
+
bundle
|
50
|
+
bundle exec appraisal install
|
51
|
+
bundle exec appraisal rspec
|
52
|
+
```
|
53
|
+
|
54
|
+
|
55
|
+
## License
|
56
|
+
|
57
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
58
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'environmenter/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'environmenter'
|
8
|
+
spec.version = Environmenter::VERSION
|
9
|
+
spec.authors = ['Eric Saxby']
|
10
|
+
spec.email = ['sax@livinginthepast.org']
|
11
|
+
|
12
|
+
spec.summary = %q{Optionally load a Rails environment from other processes}
|
13
|
+
spec.description = %q{Optionally load a Rails environment from other processes.}
|
14
|
+
spec.homepage = 'https://github.com/messagebus/environmenter'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = 'bin'
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_development_dependency 'appraisal', '~> 2.1'
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
24
|
+
spec.add_development_dependency 'pry-nav'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
27
|
+
end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
environmenter (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
actionmailer (3.2.14)
|
10
|
+
actionpack (= 3.2.14)
|
11
|
+
mail (~> 2.5.4)
|
12
|
+
actionpack (3.2.14)
|
13
|
+
activemodel (= 3.2.14)
|
14
|
+
activesupport (= 3.2.14)
|
15
|
+
builder (~> 3.0.0)
|
16
|
+
erubis (~> 2.7.0)
|
17
|
+
journey (~> 1.0.4)
|
18
|
+
rack (~> 1.4.5)
|
19
|
+
rack-cache (~> 1.2)
|
20
|
+
rack-test (~> 0.6.1)
|
21
|
+
sprockets (~> 2.2.1)
|
22
|
+
activemodel (3.2.14)
|
23
|
+
activesupport (= 3.2.14)
|
24
|
+
builder (~> 3.0.0)
|
25
|
+
activerecord (3.2.14)
|
26
|
+
activemodel (= 3.2.14)
|
27
|
+
activesupport (= 3.2.14)
|
28
|
+
arel (~> 3.0.2)
|
29
|
+
tzinfo (~> 0.3.29)
|
30
|
+
activeresource (3.2.14)
|
31
|
+
activemodel (= 3.2.14)
|
32
|
+
activesupport (= 3.2.14)
|
33
|
+
activesupport (3.2.14)
|
34
|
+
i18n (~> 0.6, >= 0.6.4)
|
35
|
+
multi_json (~> 1.0)
|
36
|
+
appraisal (2.1.0)
|
37
|
+
bundler
|
38
|
+
rake
|
39
|
+
thor (>= 0.14.0)
|
40
|
+
arel (3.0.3)
|
41
|
+
builder (3.0.4)
|
42
|
+
coderay (1.1.0)
|
43
|
+
diff-lcs (1.2.5)
|
44
|
+
erubis (2.7.0)
|
45
|
+
hike (1.2.3)
|
46
|
+
i18n (0.7.0)
|
47
|
+
journey (1.0.4)
|
48
|
+
json (1.8.3)
|
49
|
+
mail (2.5.4)
|
50
|
+
mime-types (~> 1.16)
|
51
|
+
treetop (~> 1.4.8)
|
52
|
+
method_source (0.8.2)
|
53
|
+
mime-types (1.25.1)
|
54
|
+
multi_json (1.11.2)
|
55
|
+
polyglot (0.3.5)
|
56
|
+
pry (0.10.3)
|
57
|
+
coderay (~> 1.1.0)
|
58
|
+
method_source (~> 0.8.1)
|
59
|
+
slop (~> 3.4)
|
60
|
+
pry-nav (0.2.4)
|
61
|
+
pry (>= 0.9.10, < 0.11.0)
|
62
|
+
rack (1.4.7)
|
63
|
+
rack-cache (1.6.0)
|
64
|
+
rack (>= 0.4)
|
65
|
+
rack-ssl (1.3.4)
|
66
|
+
rack
|
67
|
+
rack-test (0.6.3)
|
68
|
+
rack (>= 1.0)
|
69
|
+
rails (3.2.14)
|
70
|
+
actionmailer (= 3.2.14)
|
71
|
+
actionpack (= 3.2.14)
|
72
|
+
activerecord (= 3.2.14)
|
73
|
+
activeresource (= 3.2.14)
|
74
|
+
activesupport (= 3.2.14)
|
75
|
+
bundler (~> 1.0)
|
76
|
+
railties (= 3.2.14)
|
77
|
+
railties (3.2.14)
|
78
|
+
actionpack (= 3.2.14)
|
79
|
+
activesupport (= 3.2.14)
|
80
|
+
rack-ssl (~> 1.3.2)
|
81
|
+
rake (>= 0.8.7)
|
82
|
+
rdoc (~> 3.4)
|
83
|
+
thor (>= 0.14.6, < 2.0)
|
84
|
+
rake (10.5.0)
|
85
|
+
rdoc (3.12.2)
|
86
|
+
json (~> 1.4)
|
87
|
+
rspec (3.4.0)
|
88
|
+
rspec-core (~> 3.4.0)
|
89
|
+
rspec-expectations (~> 3.4.0)
|
90
|
+
rspec-mocks (~> 3.4.0)
|
91
|
+
rspec-core (3.4.2)
|
92
|
+
rspec-support (~> 3.4.0)
|
93
|
+
rspec-expectations (3.4.0)
|
94
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
95
|
+
rspec-support (~> 3.4.0)
|
96
|
+
rspec-mocks (3.4.1)
|
97
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
98
|
+
rspec-support (~> 3.4.0)
|
99
|
+
rspec-support (3.4.1)
|
100
|
+
slop (3.6.0)
|
101
|
+
sprockets (2.2.3)
|
102
|
+
hike (~> 1.2)
|
103
|
+
multi_json (~> 1.0)
|
104
|
+
rack (~> 1.0)
|
105
|
+
tilt (~> 1.1, != 1.3.0)
|
106
|
+
thor (0.19.1)
|
107
|
+
tilt (1.4.1)
|
108
|
+
treetop (1.4.15)
|
109
|
+
polyglot
|
110
|
+
polyglot (>= 0.3.1)
|
111
|
+
tzinfo (0.3.46)
|
112
|
+
|
113
|
+
PLATFORMS
|
114
|
+
ruby
|
115
|
+
|
116
|
+
DEPENDENCIES
|
117
|
+
appraisal (~> 2.1)
|
118
|
+
bundler (~> 1.11)
|
119
|
+
environmenter!
|
120
|
+
pry-nav
|
121
|
+
rails (= 3.2.14)
|
122
|
+
rake (~> 10.0)
|
123
|
+
rspec (~> 3.4)
|
124
|
+
|
125
|
+
BUNDLED WITH
|
126
|
+
1.11.2
|
@@ -0,0 +1,141 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
environmenter (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
actionmailer (4.2.5.1)
|
10
|
+
actionpack (= 4.2.5.1)
|
11
|
+
actionview (= 4.2.5.1)
|
12
|
+
activejob (= 4.2.5.1)
|
13
|
+
mail (~> 2.5, >= 2.5.4)
|
14
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
15
|
+
actionpack (4.2.5.1)
|
16
|
+
actionview (= 4.2.5.1)
|
17
|
+
activesupport (= 4.2.5.1)
|
18
|
+
rack (~> 1.6)
|
19
|
+
rack-test (~> 0.6.2)
|
20
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
21
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
22
|
+
actionview (4.2.5.1)
|
23
|
+
activesupport (= 4.2.5.1)
|
24
|
+
builder (~> 3.1)
|
25
|
+
erubis (~> 2.7.0)
|
26
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
27
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
+
activejob (4.2.5.1)
|
29
|
+
activesupport (= 4.2.5.1)
|
30
|
+
globalid (>= 0.3.0)
|
31
|
+
activemodel (4.2.5.1)
|
32
|
+
activesupport (= 4.2.5.1)
|
33
|
+
builder (~> 3.1)
|
34
|
+
activerecord (4.2.5.1)
|
35
|
+
activemodel (= 4.2.5.1)
|
36
|
+
activesupport (= 4.2.5.1)
|
37
|
+
arel (~> 6.0)
|
38
|
+
activesupport (4.2.5.1)
|
39
|
+
i18n (~> 0.7)
|
40
|
+
json (~> 1.7, >= 1.7.7)
|
41
|
+
minitest (~> 5.1)
|
42
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
43
|
+
tzinfo (~> 1.1)
|
44
|
+
appraisal (2.1.0)
|
45
|
+
bundler
|
46
|
+
rake
|
47
|
+
thor (>= 0.14.0)
|
48
|
+
arel (6.0.3)
|
49
|
+
builder (3.2.2)
|
50
|
+
coderay (1.1.0)
|
51
|
+
concurrent-ruby (1.0.0)
|
52
|
+
diff-lcs (1.2.5)
|
53
|
+
erubis (2.7.0)
|
54
|
+
globalid (0.3.6)
|
55
|
+
activesupport (>= 4.1.0)
|
56
|
+
i18n (0.7.0)
|
57
|
+
json (1.8.3)
|
58
|
+
loofah (2.0.3)
|
59
|
+
nokogiri (>= 1.5.9)
|
60
|
+
mail (2.6.3)
|
61
|
+
mime-types (>= 1.16, < 3)
|
62
|
+
method_source (0.8.2)
|
63
|
+
mime-types (2.99)
|
64
|
+
mini_portile2 (2.0.0)
|
65
|
+
minitest (5.8.4)
|
66
|
+
nokogiri (1.6.7.2)
|
67
|
+
mini_portile2 (~> 2.0.0.rc2)
|
68
|
+
pry (0.10.3)
|
69
|
+
coderay (~> 1.1.0)
|
70
|
+
method_source (~> 0.8.1)
|
71
|
+
slop (~> 3.4)
|
72
|
+
pry-nav (0.2.4)
|
73
|
+
pry (>= 0.9.10, < 0.11.0)
|
74
|
+
rack (1.6.4)
|
75
|
+
rack-test (0.6.3)
|
76
|
+
rack (>= 1.0)
|
77
|
+
rails (4.2.5.1)
|
78
|
+
actionmailer (= 4.2.5.1)
|
79
|
+
actionpack (= 4.2.5.1)
|
80
|
+
actionview (= 4.2.5.1)
|
81
|
+
activejob (= 4.2.5.1)
|
82
|
+
activemodel (= 4.2.5.1)
|
83
|
+
activerecord (= 4.2.5.1)
|
84
|
+
activesupport (= 4.2.5.1)
|
85
|
+
bundler (>= 1.3.0, < 2.0)
|
86
|
+
railties (= 4.2.5.1)
|
87
|
+
sprockets-rails
|
88
|
+
rails-deprecated_sanitizer (1.0.3)
|
89
|
+
activesupport (>= 4.2.0.alpha)
|
90
|
+
rails-dom-testing (1.0.7)
|
91
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
92
|
+
nokogiri (~> 1.6.0)
|
93
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
94
|
+
rails-html-sanitizer (1.0.3)
|
95
|
+
loofah (~> 2.0)
|
96
|
+
railties (4.2.5.1)
|
97
|
+
actionpack (= 4.2.5.1)
|
98
|
+
activesupport (= 4.2.5.1)
|
99
|
+
rake (>= 0.8.7)
|
100
|
+
thor (>= 0.18.1, < 2.0)
|
101
|
+
rake (10.5.0)
|
102
|
+
rspec (3.4.0)
|
103
|
+
rspec-core (~> 3.4.0)
|
104
|
+
rspec-expectations (~> 3.4.0)
|
105
|
+
rspec-mocks (~> 3.4.0)
|
106
|
+
rspec-core (3.4.2)
|
107
|
+
rspec-support (~> 3.4.0)
|
108
|
+
rspec-expectations (3.4.0)
|
109
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
110
|
+
rspec-support (~> 3.4.0)
|
111
|
+
rspec-mocks (3.4.1)
|
112
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
113
|
+
rspec-support (~> 3.4.0)
|
114
|
+
rspec-support (3.4.1)
|
115
|
+
slop (3.6.0)
|
116
|
+
sprockets (3.5.2)
|
117
|
+
concurrent-ruby (~> 1.0)
|
118
|
+
rack (> 1, < 3)
|
119
|
+
sprockets-rails (3.0.1)
|
120
|
+
actionpack (>= 4.0)
|
121
|
+
activesupport (>= 4.0)
|
122
|
+
sprockets (>= 3.0.0)
|
123
|
+
thor (0.19.1)
|
124
|
+
thread_safe (0.3.5)
|
125
|
+
tzinfo (1.2.2)
|
126
|
+
thread_safe (~> 0.1)
|
127
|
+
|
128
|
+
PLATFORMS
|
129
|
+
ruby
|
130
|
+
|
131
|
+
DEPENDENCIES
|
132
|
+
appraisal (~> 2.1)
|
133
|
+
bundler (~> 1.11)
|
134
|
+
environmenter!
|
135
|
+
pry-nav
|
136
|
+
rails (= 4.2.5.1)
|
137
|
+
rake (~> 10.0)
|
138
|
+
rspec (~> 3.4)
|
139
|
+
|
140
|
+
BUNDLED WITH
|
141
|
+
1.11.2
|
@@ -0,0 +1,51 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
environmenter (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
appraisal (2.1.0)
|
10
|
+
bundler
|
11
|
+
rake
|
12
|
+
thor (>= 0.14.0)
|
13
|
+
coderay (1.1.0)
|
14
|
+
diff-lcs (1.2.5)
|
15
|
+
method_source (0.8.2)
|
16
|
+
pry (0.10.3)
|
17
|
+
coderay (~> 1.1.0)
|
18
|
+
method_source (~> 0.8.1)
|
19
|
+
slop (~> 3.4)
|
20
|
+
pry-nav (0.2.4)
|
21
|
+
pry (>= 0.9.10, < 0.11.0)
|
22
|
+
rake (10.5.0)
|
23
|
+
rspec (3.4.0)
|
24
|
+
rspec-core (~> 3.4.0)
|
25
|
+
rspec-expectations (~> 3.4.0)
|
26
|
+
rspec-mocks (~> 3.4.0)
|
27
|
+
rspec-core (3.4.2)
|
28
|
+
rspec-support (~> 3.4.0)
|
29
|
+
rspec-expectations (3.4.0)
|
30
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
+
rspec-support (~> 3.4.0)
|
32
|
+
rspec-mocks (3.4.1)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.4.0)
|
35
|
+
rspec-support (3.4.1)
|
36
|
+
slop (3.6.0)
|
37
|
+
thor (0.19.1)
|
38
|
+
|
39
|
+
PLATFORMS
|
40
|
+
ruby
|
41
|
+
|
42
|
+
DEPENDENCIES
|
43
|
+
appraisal (~> 2.1)
|
44
|
+
bundler (~> 1.11)
|
45
|
+
environmenter!
|
46
|
+
pry-nav
|
47
|
+
rake (~> 10.0)
|
48
|
+
rspec (~> 3.4)
|
49
|
+
|
50
|
+
BUNDLED WITH
|
51
|
+
1.11.2
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module Environmenter
|
2
|
+
class Loader
|
3
|
+
attr_reader :config
|
4
|
+
|
5
|
+
def initialize(config = nil)
|
6
|
+
@config = config
|
7
|
+
end
|
8
|
+
|
9
|
+
def load!
|
10
|
+
set_environment
|
11
|
+
load_rails
|
12
|
+
require_from_config
|
13
|
+
end
|
14
|
+
|
15
|
+
def set_environment
|
16
|
+
ENV['RAILS_ENV'] ||= 'development'
|
17
|
+
ENV['RACK_ENV'] ||= ENV['RAILS_ENV']
|
18
|
+
end
|
19
|
+
|
20
|
+
def load_rails
|
21
|
+
begin
|
22
|
+
require 'rails'
|
23
|
+
if ::Rails.application.respond_to?(:eager_load)
|
24
|
+
require File.expand_path('config/environment.rb')
|
25
|
+
::Rails.application.eager_load!
|
26
|
+
else
|
27
|
+
require File.expand_path('config/application.rb')
|
28
|
+
::Rails::Application.initializer "lapine.load_rails" do
|
29
|
+
::Rails.application.config.eager_load = true
|
30
|
+
end
|
31
|
+
require File.expand_path('config/environment.rb')
|
32
|
+
end
|
33
|
+
rescue LoadError
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def require_from_config
|
38
|
+
return unless config
|
39
|
+
|
40
|
+
if config.respond_to?(:require) && config.require
|
41
|
+
return config.require.each do |file|
|
42
|
+
require File.expand_path(file)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
if config.respond_to?(:[])
|
47
|
+
if config['require']
|
48
|
+
return config['require'].each do |file|
|
49
|
+
require File.expand_path(file)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
if config[:require]
|
54
|
+
return config[:require].each do |file|
|
55
|
+
require File.expand_path(file)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
metadata
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: environmenter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eric Saxby
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: appraisal
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.1'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.11'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.11'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry-nav
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.4'
|
83
|
+
description: Optionally load a Rails environment from other processes.
|
84
|
+
email:
|
85
|
+
- sax@livinginthepast.org
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- Appraisals
|
93
|
+
- CODE_OF_CONDUCT.md
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- environmenter.gemspec
|
99
|
+
- gemfiles/rails_3.gemfile
|
100
|
+
- gemfiles/rails_3.gemfile.lock
|
101
|
+
- gemfiles/rails_4.gemfile
|
102
|
+
- gemfiles/rails_4.gemfile.lock
|
103
|
+
- gemfiles/rails_none.gemfile
|
104
|
+
- gemfiles/rails_none.gemfile.lock
|
105
|
+
- lib/environmenter.rb
|
106
|
+
- lib/environmenter/loader.rb
|
107
|
+
- lib/environmenter/version.rb
|
108
|
+
homepage: https://github.com/messagebus/environmenter
|
109
|
+
licenses:
|
110
|
+
- MIT
|
111
|
+
metadata: {}
|
112
|
+
post_install_message:
|
113
|
+
rdoc_options: []
|
114
|
+
require_paths:
|
115
|
+
- lib
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
requirements: []
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 2.2.5
|
129
|
+
signing_key:
|
130
|
+
specification_version: 4
|
131
|
+
summary: Optionally load a Rails environment from other processes
|
132
|
+
test_files: []
|