rails_env_local 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 +10 -0
- data/.rspec +2 -0
- data/.travis.yml +10 -0
- data/Appraisals +15 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +128 -0
- data/Rakefile +9 -0
- data/bin/console +14 -0
- data/bin/setup +9 -0
- data/gemfiles/rails_3_2.gemfile +7 -0
- data/gemfiles/rails_3_2.gemfile.lock +118 -0
- data/gemfiles/rails_4_1.gemfile +7 -0
- data/gemfiles/rails_4_1.gemfile.lock +108 -0
- data/gemfiles/rails_4_2.gemfile +7 -0
- data/gemfiles/rails_4_2.gemfile.lock +133 -0
- data/gemfiles/rails_5_0.gemfile +7 -0
- data/gemfiles/rails_5_0.gemfile.lock +143 -0
- data/lib/rails_env_local.rb +48 -0
- data/lib/rails_env_local/version.rb +3 -0
- data/rails_env_local.gemspec +32 -0
- metadata +152 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9d91a33d8b8aa5718c65ce4aed867b5a0d39df3c
|
4
|
+
data.tar.gz: 1860911d7744c0cf5dfdef888539d0c5c48b1dcd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2a6f49e08d571ce7cbc3c267335f909c7818b1a5925ee2729e3f799eb9f81b6806fed720db0ea51d6a927f856a85ada49aaf8408e77ff5c430f29b92199a0891
|
7
|
+
data.tar.gz: a008f8b8d3147c0a4013ddc94eef9b98c7224a06dd8d1623b066af89730134adae592e460193dc268d8bc0af7d5cad016f21dc895830f287d75b2b8052e3a633
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Appraisals
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
appraise "rails-3-2" do
|
2
|
+
gem "rails", "~> 3.2.22.2"
|
3
|
+
end
|
4
|
+
|
5
|
+
appraise "rails-4-1" do
|
6
|
+
gem "rails", "~> 4.1.15"
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise "rails-4-2" do
|
10
|
+
gem "rails", "~> 4.2.6"
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise "rails-5-0" do
|
14
|
+
gem "rails", "~> 5.0.0.beta3"
|
15
|
+
end
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2016 Peter Boling, http://www.railsbling.com/
|
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,128 @@
|
|
1
|
+
# RailsEnvLocal
|
2
|
+
|
3
|
+
`rails_env_local`, where a rails environment for local development can be anything it desires. Even a `butterfly`. Tell your DevOps friends.
|
4
|
+
|
5
|
+
[Rails Guides](http://guides.rubyonrails.org/initialization.html) has more information on the Rails initialization routines. You can easily accomplish what this gem does in a few lines of code.
|
6
|
+
|
7
|
+
... But are you going to write specs for code in your `config/boot.rb` file? Really?
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'rails_env_local', require: false
|
15
|
+
```
|
16
|
+
|
17
|
+
`require: false` because we want to control when it is loaded.
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install rails_env_local
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
In config/boot.rb you have:
|
30
|
+
|
31
|
+
require 'bundler/setup'
|
32
|
+
|
33
|
+
After that line (or before, see NOTE below) add:
|
34
|
+
|
35
|
+
require 'rails_env_local'
|
36
|
+
RailsEnvLocal.set_local_environment
|
37
|
+
|
38
|
+
NOTE: If you need your custom local environment to be set before some of the other gems you use, because they rely on the environment being set early, then just place the two lines above *before* the `require 'bundler/setup'`. Simple as that.
|
39
|
+
|
40
|
+
## Compatibility
|
41
|
+
|
42
|
+
This gem can should work with any version of Rails that uses `Rails.env`, but it is only tested with Rails 3.2, 4.1, 4.2, and 5.0.
|
43
|
+
|
44
|
+
This gem is tested with Ruby 2.2-latest and 2.3-latest. It should work with any version of Ruby that supports both Ruby 1.9 hashes and double splat arguments.
|
45
|
+
|
46
|
+
### Options:
|
47
|
+
|
48
|
+
#### `environment`
|
49
|
+
* Type: a string
|
50
|
+
* Default: `"local"`
|
51
|
+
* Effect: Sets the Rails environment (`Rails.env`) to the given string
|
52
|
+
* Example:
|
53
|
+
|
54
|
+
RailsEnvLocal.set_local_environment(environment: "panda")
|
55
|
+
|
56
|
+
#### `verbose`
|
57
|
+
* Type: boolean
|
58
|
+
* Default: `false`
|
59
|
+
* Effect: Prints the environment to `STDOUT` as it is being set
|
60
|
+
* Example:
|
61
|
+
|
62
|
+
RailsEnvLocal.set_local_environment(verbose: true)
|
63
|
+
|
64
|
+
#### `set_rack_env`
|
65
|
+
* Type: boolean
|
66
|
+
* Default: `true`
|
67
|
+
* Effect: In addition to setting `Rails.env`, will set `ENV["RAILS_ENV"]` to match `Rails.env`
|
68
|
+
* Example:
|
69
|
+
|
70
|
+
RailsEnvLocal.set_local_environment(set_rack_env: false)
|
71
|
+
|
72
|
+
#### `set_rails_env`
|
73
|
+
* Type: boolean
|
74
|
+
* Default: `true`
|
75
|
+
* Effect: In addition to setting `Rails.env`, will set `ENV["RACK_ENV"]` to match `Rails.env`
|
76
|
+
* Example:
|
77
|
+
|
78
|
+
RailsEnvLocal.set_local_environment(set_rails_env: false)
|
79
|
+
|
80
|
+
## Development
|
81
|
+
|
82
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run a single suite of tests, or run `wwtd` to run all specs like TravisCI would. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
83
|
+
|
84
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
85
|
+
|
86
|
+
## Authors
|
87
|
+
|
88
|
+
[Peter Boling][mygithub], and ideally there would be some [contributors][contributors].
|
89
|
+
|
90
|
+
Find out more about Peter Boling's work at [RailsBling.com][railsbling]
|
91
|
+
|
92
|
+
## Contributing
|
93
|
+
|
94
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pboling/rails_env_local.
|
95
|
+
|
96
|
+
To add your own ideas to this code base:
|
97
|
+
|
98
|
+
1. Fork it
|
99
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
100
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
101
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
102
|
+
5. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
103
|
+
6. Create new Pull Request
|
104
|
+
|
105
|
+
|
106
|
+
## Versioning
|
107
|
+
|
108
|
+
This library aims to adhere to [Semantic Versioning 2.0.0][semver].
|
109
|
+
Violations of this scheme should be reported as bugs. Specifically,
|
110
|
+
if a minor or patch version is released that breaks backward
|
111
|
+
compatibility, a new version should be immediately released that
|
112
|
+
restores compatibility. Breaking changes to the public API will
|
113
|
+
only be introduced with new major versions.
|
114
|
+
|
115
|
+
As a result of this policy, you can (and should) specify a
|
116
|
+
dependency on this gem using the [Pessimistic Version Constraint][pvc] with two digits of precision.
|
117
|
+
|
118
|
+
For example:
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
spec.add_dependency 'rails_env_local', '~> 0.1'
|
122
|
+
```
|
123
|
+
|
124
|
+
[semver]: http://semver.org/
|
125
|
+
[pvc]: http://docs.rubygems.org/read/chapter/16#page74
|
126
|
+
[railsbling]: http://www.railsbling.com
|
127
|
+
[mygithub]: http://github.com/pboling
|
128
|
+
[contributors]: https://github.com/pboling/flag_shih_tzu/contributors
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "rails_env_local"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
rails_env_local (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
actionmailer (3.2.22.2)
|
10
|
+
actionpack (= 3.2.22.2)
|
11
|
+
mail (~> 2.5.4)
|
12
|
+
actionpack (3.2.22.2)
|
13
|
+
activemodel (= 3.2.22.2)
|
14
|
+
activesupport (= 3.2.22.2)
|
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.22.2)
|
23
|
+
activesupport (= 3.2.22.2)
|
24
|
+
builder (~> 3.0.0)
|
25
|
+
activerecord (3.2.22.2)
|
26
|
+
activemodel (= 3.2.22.2)
|
27
|
+
activesupport (= 3.2.22.2)
|
28
|
+
arel (~> 3.0.2)
|
29
|
+
tzinfo (~> 0.3.29)
|
30
|
+
activeresource (3.2.22.2)
|
31
|
+
activemodel (= 3.2.22.2)
|
32
|
+
activesupport (= 3.2.22.2)
|
33
|
+
activesupport (3.2.22.2)
|
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
|
+
diff-lcs (1.2.5)
|
43
|
+
erubis (2.7.0)
|
44
|
+
hike (1.2.3)
|
45
|
+
i18n (0.7.0)
|
46
|
+
journey (1.0.4)
|
47
|
+
json (1.8.3)
|
48
|
+
mail (2.5.4)
|
49
|
+
mime-types (~> 1.16)
|
50
|
+
treetop (~> 1.4.8)
|
51
|
+
mime-types (1.25.1)
|
52
|
+
multi_json (1.11.2)
|
53
|
+
polyglot (0.3.5)
|
54
|
+
rack (1.4.7)
|
55
|
+
rack-cache (1.6.1)
|
56
|
+
rack (>= 0.4)
|
57
|
+
rack-ssl (1.3.4)
|
58
|
+
rack
|
59
|
+
rack-test (0.6.3)
|
60
|
+
rack (>= 1.0)
|
61
|
+
rails (3.2.22.2)
|
62
|
+
actionmailer (= 3.2.22.2)
|
63
|
+
actionpack (= 3.2.22.2)
|
64
|
+
activerecord (= 3.2.22.2)
|
65
|
+
activeresource (= 3.2.22.2)
|
66
|
+
activesupport (= 3.2.22.2)
|
67
|
+
bundler (~> 1.0)
|
68
|
+
railties (= 3.2.22.2)
|
69
|
+
railties (3.2.22.2)
|
70
|
+
actionpack (= 3.2.22.2)
|
71
|
+
activesupport (= 3.2.22.2)
|
72
|
+
rack-ssl (~> 1.3.2)
|
73
|
+
rake (>= 0.8.7)
|
74
|
+
rdoc (~> 3.4)
|
75
|
+
thor (>= 0.14.6, < 2.0)
|
76
|
+
rake (10.5.0)
|
77
|
+
rdoc (3.12.2)
|
78
|
+
json (~> 1.4)
|
79
|
+
rspec (3.4.0)
|
80
|
+
rspec-core (~> 3.4.0)
|
81
|
+
rspec-expectations (~> 3.4.0)
|
82
|
+
rspec-mocks (~> 3.4.0)
|
83
|
+
rspec-core (3.4.3)
|
84
|
+
rspec-support (~> 3.4.0)
|
85
|
+
rspec-expectations (3.4.0)
|
86
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
87
|
+
rspec-support (~> 3.4.0)
|
88
|
+
rspec-mocks (3.4.1)
|
89
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
90
|
+
rspec-support (~> 3.4.0)
|
91
|
+
rspec-support (3.4.1)
|
92
|
+
sprockets (2.2.3)
|
93
|
+
hike (~> 1.2)
|
94
|
+
multi_json (~> 1.0)
|
95
|
+
rack (~> 1.0)
|
96
|
+
tilt (~> 1.1, != 1.3.0)
|
97
|
+
thor (0.19.1)
|
98
|
+
tilt (1.4.1)
|
99
|
+
treetop (1.4.15)
|
100
|
+
polyglot
|
101
|
+
polyglot (>= 0.3.1)
|
102
|
+
tzinfo (0.3.46)
|
103
|
+
wwtd (1.3.0)
|
104
|
+
|
105
|
+
PLATFORMS
|
106
|
+
ruby
|
107
|
+
|
108
|
+
DEPENDENCIES
|
109
|
+
appraisal (~> 2.1)
|
110
|
+
bundler (~> 1.11)
|
111
|
+
rails (~> 3.2.22.2)
|
112
|
+
rails_env_local!
|
113
|
+
rake (~> 10.5)
|
114
|
+
rspec (~> 3.4)
|
115
|
+
wwtd (~> 1.3)
|
116
|
+
|
117
|
+
BUNDLED WITH
|
118
|
+
1.11.2
|
@@ -0,0 +1,108 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
rails_env_local (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
actionmailer (4.1.15)
|
10
|
+
actionpack (= 4.1.15)
|
11
|
+
actionview (= 4.1.15)
|
12
|
+
mail (~> 2.5, >= 2.5.4)
|
13
|
+
actionpack (4.1.15)
|
14
|
+
actionview (= 4.1.15)
|
15
|
+
activesupport (= 4.1.15)
|
16
|
+
rack (~> 1.5.2)
|
17
|
+
rack-test (~> 0.6.2)
|
18
|
+
actionview (4.1.15)
|
19
|
+
activesupport (= 4.1.15)
|
20
|
+
builder (~> 3.1)
|
21
|
+
erubis (~> 2.7.0)
|
22
|
+
activemodel (4.1.15)
|
23
|
+
activesupport (= 4.1.15)
|
24
|
+
builder (~> 3.1)
|
25
|
+
activerecord (4.1.15)
|
26
|
+
activemodel (= 4.1.15)
|
27
|
+
activesupport (= 4.1.15)
|
28
|
+
arel (~> 5.0.0)
|
29
|
+
activesupport (4.1.15)
|
30
|
+
i18n (~> 0.6, >= 0.6.9)
|
31
|
+
json (~> 1.7, >= 1.7.7)
|
32
|
+
minitest (~> 5.1)
|
33
|
+
thread_safe (~> 0.1)
|
34
|
+
tzinfo (~> 1.1)
|
35
|
+
appraisal (2.1.0)
|
36
|
+
bundler
|
37
|
+
rake
|
38
|
+
thor (>= 0.14.0)
|
39
|
+
arel (5.0.1.20140414130214)
|
40
|
+
builder (3.2.2)
|
41
|
+
concurrent-ruby (1.0.1)
|
42
|
+
diff-lcs (1.2.5)
|
43
|
+
erubis (2.7.0)
|
44
|
+
i18n (0.7.0)
|
45
|
+
json (1.8.3)
|
46
|
+
mail (2.6.3)
|
47
|
+
mime-types (>= 1.16, < 3)
|
48
|
+
mime-types (2.99.1)
|
49
|
+
minitest (5.8.4)
|
50
|
+
rack (1.5.5)
|
51
|
+
rack-test (0.6.3)
|
52
|
+
rack (>= 1.0)
|
53
|
+
rails (4.1.15)
|
54
|
+
actionmailer (= 4.1.15)
|
55
|
+
actionpack (= 4.1.15)
|
56
|
+
actionview (= 4.1.15)
|
57
|
+
activemodel (= 4.1.15)
|
58
|
+
activerecord (= 4.1.15)
|
59
|
+
activesupport (= 4.1.15)
|
60
|
+
bundler (>= 1.3.0, < 2.0)
|
61
|
+
railties (= 4.1.15)
|
62
|
+
sprockets-rails (~> 2.0)
|
63
|
+
railties (4.1.15)
|
64
|
+
actionpack (= 4.1.15)
|
65
|
+
activesupport (= 4.1.15)
|
66
|
+
rake (>= 0.8.7)
|
67
|
+
thor (>= 0.18.1, < 2.0)
|
68
|
+
rake (10.5.0)
|
69
|
+
rspec (3.4.0)
|
70
|
+
rspec-core (~> 3.4.0)
|
71
|
+
rspec-expectations (~> 3.4.0)
|
72
|
+
rspec-mocks (~> 3.4.0)
|
73
|
+
rspec-core (3.4.3)
|
74
|
+
rspec-support (~> 3.4.0)
|
75
|
+
rspec-expectations (3.4.0)
|
76
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
77
|
+
rspec-support (~> 3.4.0)
|
78
|
+
rspec-mocks (3.4.1)
|
79
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
80
|
+
rspec-support (~> 3.4.0)
|
81
|
+
rspec-support (3.4.1)
|
82
|
+
sprockets (3.5.2)
|
83
|
+
concurrent-ruby (~> 1.0)
|
84
|
+
rack (> 1, < 3)
|
85
|
+
sprockets-rails (2.3.3)
|
86
|
+
actionpack (>= 3.0)
|
87
|
+
activesupport (>= 3.0)
|
88
|
+
sprockets (>= 2.8, < 4.0)
|
89
|
+
thor (0.19.1)
|
90
|
+
thread_safe (0.3.5)
|
91
|
+
tzinfo (1.2.2)
|
92
|
+
thread_safe (~> 0.1)
|
93
|
+
wwtd (1.3.0)
|
94
|
+
|
95
|
+
PLATFORMS
|
96
|
+
ruby
|
97
|
+
|
98
|
+
DEPENDENCIES
|
99
|
+
appraisal (~> 2.1)
|
100
|
+
bundler (~> 1.11)
|
101
|
+
rails (~> 4.1.15)
|
102
|
+
rails_env_local!
|
103
|
+
rake (~> 10.5)
|
104
|
+
rspec (~> 3.4)
|
105
|
+
wwtd (~> 1.3)
|
106
|
+
|
107
|
+
BUNDLED WITH
|
108
|
+
1.11.2
|
@@ -0,0 +1,133 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
rails_env_local (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
actionmailer (4.2.6)
|
10
|
+
actionpack (= 4.2.6)
|
11
|
+
actionview (= 4.2.6)
|
12
|
+
activejob (= 4.2.6)
|
13
|
+
mail (~> 2.5, >= 2.5.4)
|
14
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
15
|
+
actionpack (4.2.6)
|
16
|
+
actionview (= 4.2.6)
|
17
|
+
activesupport (= 4.2.6)
|
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.6)
|
23
|
+
activesupport (= 4.2.6)
|
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.6)
|
29
|
+
activesupport (= 4.2.6)
|
30
|
+
globalid (>= 0.3.0)
|
31
|
+
activemodel (4.2.6)
|
32
|
+
activesupport (= 4.2.6)
|
33
|
+
builder (~> 3.1)
|
34
|
+
activerecord (4.2.6)
|
35
|
+
activemodel (= 4.2.6)
|
36
|
+
activesupport (= 4.2.6)
|
37
|
+
arel (~> 6.0)
|
38
|
+
activesupport (4.2.6)
|
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
|
+
concurrent-ruby (1.0.1)
|
51
|
+
diff-lcs (1.2.5)
|
52
|
+
erubis (2.7.0)
|
53
|
+
globalid (0.3.6)
|
54
|
+
activesupport (>= 4.1.0)
|
55
|
+
i18n (0.7.0)
|
56
|
+
json (1.8.3)
|
57
|
+
loofah (2.0.3)
|
58
|
+
nokogiri (>= 1.5.9)
|
59
|
+
mail (2.6.3)
|
60
|
+
mime-types (>= 1.16, < 3)
|
61
|
+
mime-types (2.99.1)
|
62
|
+
mini_portile2 (2.0.0)
|
63
|
+
minitest (5.8.4)
|
64
|
+
nokogiri (1.6.7.2)
|
65
|
+
mini_portile2 (~> 2.0.0.rc2)
|
66
|
+
rack (1.6.4)
|
67
|
+
rack-test (0.6.3)
|
68
|
+
rack (>= 1.0)
|
69
|
+
rails (4.2.6)
|
70
|
+
actionmailer (= 4.2.6)
|
71
|
+
actionpack (= 4.2.6)
|
72
|
+
actionview (= 4.2.6)
|
73
|
+
activejob (= 4.2.6)
|
74
|
+
activemodel (= 4.2.6)
|
75
|
+
activerecord (= 4.2.6)
|
76
|
+
activesupport (= 4.2.6)
|
77
|
+
bundler (>= 1.3.0, < 2.0)
|
78
|
+
railties (= 4.2.6)
|
79
|
+
sprockets-rails
|
80
|
+
rails-deprecated_sanitizer (1.0.3)
|
81
|
+
activesupport (>= 4.2.0.alpha)
|
82
|
+
rails-dom-testing (1.0.7)
|
83
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
84
|
+
nokogiri (~> 1.6.0)
|
85
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
86
|
+
rails-html-sanitizer (1.0.3)
|
87
|
+
loofah (~> 2.0)
|
88
|
+
railties (4.2.6)
|
89
|
+
actionpack (= 4.2.6)
|
90
|
+
activesupport (= 4.2.6)
|
91
|
+
rake (>= 0.8.7)
|
92
|
+
thor (>= 0.18.1, < 2.0)
|
93
|
+
rake (10.5.0)
|
94
|
+
rspec (3.4.0)
|
95
|
+
rspec-core (~> 3.4.0)
|
96
|
+
rspec-expectations (~> 3.4.0)
|
97
|
+
rspec-mocks (~> 3.4.0)
|
98
|
+
rspec-core (3.4.3)
|
99
|
+
rspec-support (~> 3.4.0)
|
100
|
+
rspec-expectations (3.4.0)
|
101
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
102
|
+
rspec-support (~> 3.4.0)
|
103
|
+
rspec-mocks (3.4.1)
|
104
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
105
|
+
rspec-support (~> 3.4.0)
|
106
|
+
rspec-support (3.4.1)
|
107
|
+
sprockets (3.5.2)
|
108
|
+
concurrent-ruby (~> 1.0)
|
109
|
+
rack (> 1, < 3)
|
110
|
+
sprockets-rails (3.0.4)
|
111
|
+
actionpack (>= 4.0)
|
112
|
+
activesupport (>= 4.0)
|
113
|
+
sprockets (>= 3.0.0)
|
114
|
+
thor (0.19.1)
|
115
|
+
thread_safe (0.3.5)
|
116
|
+
tzinfo (1.2.2)
|
117
|
+
thread_safe (~> 0.1)
|
118
|
+
wwtd (1.3.0)
|
119
|
+
|
120
|
+
PLATFORMS
|
121
|
+
ruby
|
122
|
+
|
123
|
+
DEPENDENCIES
|
124
|
+
appraisal (~> 2.1)
|
125
|
+
bundler (~> 1.11)
|
126
|
+
rails (~> 4.2.6)
|
127
|
+
rails_env_local!
|
128
|
+
rake (~> 10.5)
|
129
|
+
rspec (~> 3.4)
|
130
|
+
wwtd (~> 1.3)
|
131
|
+
|
132
|
+
BUNDLED WITH
|
133
|
+
1.11.2
|
@@ -0,0 +1,143 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
rails_env_local (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
actioncable (5.0.0.beta3)
|
10
|
+
actionpack (= 5.0.0.beta3)
|
11
|
+
nio4r (~> 1.2)
|
12
|
+
websocket-driver (~> 0.6.1)
|
13
|
+
actionmailer (5.0.0.beta3)
|
14
|
+
actionpack (= 5.0.0.beta3)
|
15
|
+
actionview (= 5.0.0.beta3)
|
16
|
+
activejob (= 5.0.0.beta3)
|
17
|
+
mail (~> 2.5, >= 2.5.4)
|
18
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
19
|
+
actionpack (5.0.0.beta3)
|
20
|
+
actionview (= 5.0.0.beta3)
|
21
|
+
activesupport (= 5.0.0.beta3)
|
22
|
+
rack (~> 2.x)
|
23
|
+
rack-test (~> 0.6.3)
|
24
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
25
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
26
|
+
actionview (5.0.0.beta3)
|
27
|
+
activesupport (= 5.0.0.beta3)
|
28
|
+
builder (~> 3.1)
|
29
|
+
erubis (~> 2.7.0)
|
30
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
31
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
32
|
+
activejob (5.0.0.beta3)
|
33
|
+
activesupport (= 5.0.0.beta3)
|
34
|
+
globalid (>= 0.3.6)
|
35
|
+
activemodel (5.0.0.beta3)
|
36
|
+
activesupport (= 5.0.0.beta3)
|
37
|
+
activerecord (5.0.0.beta3)
|
38
|
+
activemodel (= 5.0.0.beta3)
|
39
|
+
activesupport (= 5.0.0.beta3)
|
40
|
+
arel (~> 7.0)
|
41
|
+
activesupport (5.0.0.beta3)
|
42
|
+
concurrent-ruby (~> 1.0)
|
43
|
+
i18n (~> 0.7)
|
44
|
+
minitest (~> 5.1)
|
45
|
+
tzinfo (~> 1.1)
|
46
|
+
appraisal (2.1.0)
|
47
|
+
bundler
|
48
|
+
rake
|
49
|
+
thor (>= 0.14.0)
|
50
|
+
arel (7.0.0)
|
51
|
+
builder (3.2.2)
|
52
|
+
concurrent-ruby (1.0.1)
|
53
|
+
diff-lcs (1.2.5)
|
54
|
+
erubis (2.7.0)
|
55
|
+
globalid (0.3.6)
|
56
|
+
activesupport (>= 4.1.0)
|
57
|
+
i18n (0.7.0)
|
58
|
+
json (1.8.3)
|
59
|
+
loofah (2.0.3)
|
60
|
+
nokogiri (>= 1.5.9)
|
61
|
+
mail (2.6.3)
|
62
|
+
mime-types (>= 1.16, < 3)
|
63
|
+
method_source (0.8.2)
|
64
|
+
mime-types (2.99.1)
|
65
|
+
mini_portile2 (2.0.0)
|
66
|
+
minitest (5.8.4)
|
67
|
+
nio4r (1.2.1)
|
68
|
+
nokogiri (1.6.7.2)
|
69
|
+
mini_portile2 (~> 2.0.0.rc2)
|
70
|
+
rack (2.0.0.alpha)
|
71
|
+
json
|
72
|
+
rack-test (0.6.3)
|
73
|
+
rack (>= 1.0)
|
74
|
+
rails (5.0.0.beta3)
|
75
|
+
actioncable (= 5.0.0.beta3)
|
76
|
+
actionmailer (= 5.0.0.beta3)
|
77
|
+
actionpack (= 5.0.0.beta3)
|
78
|
+
actionview (= 5.0.0.beta3)
|
79
|
+
activejob (= 5.0.0.beta3)
|
80
|
+
activemodel (= 5.0.0.beta3)
|
81
|
+
activerecord (= 5.0.0.beta3)
|
82
|
+
activesupport (= 5.0.0.beta3)
|
83
|
+
bundler (>= 1.3.0, < 2.0)
|
84
|
+
railties (= 5.0.0.beta3)
|
85
|
+
sprockets-rails (>= 2.0.0)
|
86
|
+
rails-deprecated_sanitizer (1.0.3)
|
87
|
+
activesupport (>= 4.2.0.alpha)
|
88
|
+
rails-dom-testing (1.0.7)
|
89
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
90
|
+
nokogiri (~> 1.6.0)
|
91
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
92
|
+
rails-html-sanitizer (1.0.3)
|
93
|
+
loofah (~> 2.0)
|
94
|
+
railties (5.0.0.beta3)
|
95
|
+
actionpack (= 5.0.0.beta3)
|
96
|
+
activesupport (= 5.0.0.beta3)
|
97
|
+
method_source
|
98
|
+
rake (>= 0.8.7)
|
99
|
+
thor (>= 0.18.1, < 2.0)
|
100
|
+
rake (10.5.0)
|
101
|
+
rspec (3.4.0)
|
102
|
+
rspec-core (~> 3.4.0)
|
103
|
+
rspec-expectations (~> 3.4.0)
|
104
|
+
rspec-mocks (~> 3.4.0)
|
105
|
+
rspec-core (3.4.3)
|
106
|
+
rspec-support (~> 3.4.0)
|
107
|
+
rspec-expectations (3.4.0)
|
108
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
109
|
+
rspec-support (~> 3.4.0)
|
110
|
+
rspec-mocks (3.4.1)
|
111
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
112
|
+
rspec-support (~> 3.4.0)
|
113
|
+
rspec-support (3.4.1)
|
114
|
+
sprockets (3.5.2)
|
115
|
+
concurrent-ruby (~> 1.0)
|
116
|
+
rack (> 1, < 3)
|
117
|
+
sprockets-rails (3.0.4)
|
118
|
+
actionpack (>= 4.0)
|
119
|
+
activesupport (>= 4.0)
|
120
|
+
sprockets (>= 3.0.0)
|
121
|
+
thor (0.19.1)
|
122
|
+
thread_safe (0.3.5)
|
123
|
+
tzinfo (1.2.2)
|
124
|
+
thread_safe (~> 0.1)
|
125
|
+
websocket-driver (0.6.3)
|
126
|
+
websocket-extensions (>= 0.1.0)
|
127
|
+
websocket-extensions (0.1.2)
|
128
|
+
wwtd (1.3.0)
|
129
|
+
|
130
|
+
PLATFORMS
|
131
|
+
ruby
|
132
|
+
|
133
|
+
DEPENDENCIES
|
134
|
+
appraisal (~> 2.1)
|
135
|
+
bundler (~> 1.11)
|
136
|
+
rails (~> 5.0.0.beta3)
|
137
|
+
rails_env_local!
|
138
|
+
rake (~> 10.5)
|
139
|
+
rspec (~> 3.4)
|
140
|
+
wwtd (~> 1.3)
|
141
|
+
|
142
|
+
BUNDLED WITH
|
143
|
+
1.11.2
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require "rails_env_local/version"
|
2
|
+
require "rails"
|
3
|
+
|
4
|
+
# Usage:
|
5
|
+
#
|
6
|
+
# In config/boot.rb you have:
|
7
|
+
#
|
8
|
+
# require 'bundler/setup'
|
9
|
+
#
|
10
|
+
# After that line (or before, see NOTE below) add:
|
11
|
+
#
|
12
|
+
# require 'rails_env_local'
|
13
|
+
# RailsEnvLocal.set_local_environment
|
14
|
+
#
|
15
|
+
# NOTE: If you need your custom local environment to be set before some of the other gems you use,
|
16
|
+
# because they rely on the environment being set early,
|
17
|
+
# then just place the two lines above *before* the `require 'bundler/setup'`. Simple as that.
|
18
|
+
#
|
19
|
+
# Options:
|
20
|
+
#
|
21
|
+
# environment: a string (default is "local")
|
22
|
+
# Effect: will set the Rails environment (Rails.env) to the given string
|
23
|
+
# Example: RailsEnvLocal.set_local_environment(environment: "panda")
|
24
|
+
#
|
25
|
+
# verbose: true or false (default is false)
|
26
|
+
# Effect: will print the environment to STDOUT as it is being set
|
27
|
+
# Example: RailsEnvLocal.set_local_environment(verbose: true)
|
28
|
+
#
|
29
|
+
# set_rack_env: true or false (default is true)
|
30
|
+
# Effect: will additionally set RAILS_ENV to match Rails.env
|
31
|
+
# Example: RailsEnvLocal.set_local_environment(set_rack_env: false)
|
32
|
+
#
|
33
|
+
# set_rails_env: true or false (default is true)
|
34
|
+
# Effect: will additionally set RACK_ENV to match Rails.env
|
35
|
+
# Example: RailsEnvLocal.set_local_environment(set_rails_env: false)
|
36
|
+
|
37
|
+
module RailsEnvLocal
|
38
|
+
DEVELOPMENT_ENVIRONMENT = "development"
|
39
|
+
def self.set_local_environment(environment: "local", **options)
|
40
|
+
if ENV["RAILS_ENV"] == DEVELOPMENT_ENVIRONMENT || Rails.env == DEVELOPMENT_ENVIRONMENT
|
41
|
+
Rails.env = environment
|
42
|
+
options = {set_rails_env: true, set_rack_env: true, verbose: false}.merge(options)
|
43
|
+
ENV["RAILS_ENV"] = Rails.env if options[:set_rails_env]
|
44
|
+
ENV["RACK_ENV"] = Rails.env if options[:set_rack_env]
|
45
|
+
puts "switching to custom local development environment: #{environment}" if options[:verbose]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "rails_env_local/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "rails_env_local"
|
8
|
+
spec.version = RailsEnvLocal::VERSION
|
9
|
+
spec.licenses = ["MIT"]
|
10
|
+
spec.authors = ["Peter Boling"]
|
11
|
+
spec.email = ["peter.boling@gmail.com"]
|
12
|
+
|
13
|
+
spec.summary = %q{"development" is not always the best name for the local environment}
|
14
|
+
spec.description = <<EODESC
|
15
|
+
"development" is not always the best name for the local environment.
|
16
|
+
Sometimes an alternate environment name, like "local", makes sense,
|
17
|
+
and "dev", or "develop" may be used as a deployed environment.
|
18
|
+
EODESC
|
19
|
+
spec.homepage = "https://github.com/pboling/rails_env_local"
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
spec.add_development_dependency "rails"
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.5"
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.4"
|
30
|
+
spec.add_development_dependency "appraisal", "~> 2.1"
|
31
|
+
spec.add_development_dependency "wwtd", "~> 1.3"
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails_env_local
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Boling
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
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: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.4'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: appraisal
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.1'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: wwtd
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.3'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.3'
|
97
|
+
description: |2
|
98
|
+
"development" is not always the best name for the local environment.
|
99
|
+
Sometimes an alternate environment name, like "local", makes sense,
|
100
|
+
and "dev", or "develop" may be used as a deployed environment.
|
101
|
+
email:
|
102
|
+
- peter.boling@gmail.com
|
103
|
+
executables: []
|
104
|
+
extensions: []
|
105
|
+
extra_rdoc_files: []
|
106
|
+
files:
|
107
|
+
- ".gitignore"
|
108
|
+
- ".rspec"
|
109
|
+
- ".travis.yml"
|
110
|
+
- Appraisals
|
111
|
+
- Gemfile
|
112
|
+
- LICENSE
|
113
|
+
- README.md
|
114
|
+
- Rakefile
|
115
|
+
- bin/console
|
116
|
+
- bin/setup
|
117
|
+
- gemfiles/rails_3_2.gemfile
|
118
|
+
- gemfiles/rails_3_2.gemfile.lock
|
119
|
+
- gemfiles/rails_4_1.gemfile
|
120
|
+
- gemfiles/rails_4_1.gemfile.lock
|
121
|
+
- gemfiles/rails_4_2.gemfile
|
122
|
+
- gemfiles/rails_4_2.gemfile.lock
|
123
|
+
- gemfiles/rails_5_0.gemfile
|
124
|
+
- gemfiles/rails_5_0.gemfile.lock
|
125
|
+
- lib/rails_env_local.rb
|
126
|
+
- lib/rails_env_local/version.rb
|
127
|
+
- rails_env_local.gemspec
|
128
|
+
homepage: https://github.com/pboling/rails_env_local
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 2.4.6
|
149
|
+
signing_key:
|
150
|
+
specification_version: 4
|
151
|
+
summary: '"development" is not always the best name for the local environment'
|
152
|
+
test_files: []
|