Class: EacRubyUtils::Ruby::OnCleanEnvironment
- Defined in:
- lib/eac_ruby_utils/ruby/on_clean_environment.rb
Constant Summary collapse
- ENVVARS_PREFIXES_TO_CLEAN =
%w[BUNDLE RUBY].freeze
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#original_env ⇒ Object
readonly
Returns the value of attribute original_env.
Instance Method Summary collapse
- #envvars_prefixes_to_clean ⇒ Array<String>
-
#initialize(&block) ⇒ OnCleanEnvironment
constructor
A new instance of OnCleanEnvironment.
- #perform ⇒ Object
Constructor Details
#initialize(&block) ⇒ OnCleanEnvironment
Returns a new instance of OnCleanEnvironment.
19 20 21 22 |
# File 'lib/eac_ruby_utils/ruby/on_clean_environment.rb', line 19 def initialize(&block) @block = block @original_env = ::ENV.to_h end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
17 18 19 |
# File 'lib/eac_ruby_utils/ruby/on_clean_environment.rb', line 17 def block @block end |
#original_env ⇒ Object (readonly)
Returns the value of attribute original_env.
17 18 19 |
# File 'lib/eac_ruby_utils/ruby/on_clean_environment.rb', line 17 def original_env @original_env end |
Instance Method Details
#envvars_prefixes_to_clean ⇒ Array<String>
25 26 27 |
# File 'lib/eac_ruby_utils/ruby/on_clean_environment.rb', line 25 def envvars_prefixes_to_clean ENVVARS_PREFIXES_TO_CLEAN end |
#perform ⇒ Object
29 30 31 32 33 |
# File 'lib/eac_ruby_utils/ruby/on_clean_environment.rb', line 29 def perform bundler_with_unbundled_env do on_clean_envvars end end |