mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
add a way to handle env checks using method names
cleanup the method missing magic for enviroment test ammend space add a comment to the variable place Fixes #2356
This commit is contained in:
parent
1a2cc347b4
commit
6ca6189c74
2 changed files with 15 additions and 1 deletions
|
@ -39,6 +39,18 @@ module LogStash
|
|||
LOGSTASH_ENV
|
||||
end
|
||||
|
||||
def production?
|
||||
env.downcase == "production"
|
||||
end
|
||||
|
||||
def development?
|
||||
env.downcase == "development"
|
||||
end
|
||||
|
||||
def test?
|
||||
env.downcase == "test"
|
||||
end
|
||||
|
||||
# set GEM_PATH for logstash runtime
|
||||
# GEM_PATH should include the logstash gems, the plugin gems and the bootstrap gems.
|
||||
# the bootstrap gems are required specificly for bundler which is a runtime dependency
|
||||
|
|
|
@ -56,7 +56,9 @@ class LogStash::PluginManager::Install < Clamp::Command
|
|||
FileDependencies::Gem.hook
|
||||
options = {}
|
||||
options[:document] = []
|
||||
if LogStash::Environment.env == 'test'
|
||||
if LogStash::Environment.test?
|
||||
# More info on what do this options means
|
||||
# https://github.com/rubygems/rubygems/blob/master/lib/rubygems/dependency_installer.rb#L56
|
||||
options[:dev_shallow] = true
|
||||
options[:development] = true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue