diff options
author | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2016-01-08 13:40:52 -0800 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2016-01-11 15:00:42 -0500 |
commit | 69318b7e7f3dd3c2e4dd76da6e2d5eb774cc3762 (patch) | |
tree | 9371946700c474327224ea158b0bfcb8b109f70e /omnibus/files | |
parent | ab5c35a7f72ab7c58a463ddf1dfe937d8db84f71 (diff) | |
download | chef-69318b7e7f3dd3c2e4dd76da6e2d5eb774cc3762.tar.gz |
Remove non-chef related files
Diffstat (limited to 'omnibus/files')
3 files changed, 0 insertions, 154 deletions
diff --git a/omnibus/files/chefdk-env-customization/windows/chefdk_env_customization.rb b/omnibus/files/chefdk-env-customization/windows/chefdk_env_customization.rb deleted file mode 100644 index 34bbec4349..0000000000 --- a/omnibus/files/chefdk-env-customization/windows/chefdk_env_customization.rb +++ /dev/null @@ -1,54 +0,0 @@ -## Environment hacks for running Ruby with ChefDK ## -# ENV['HOME'] is not set by default on Windows. We need to set this to -# something sensible since a lot of Ruby code depends on it. It is important -# for this directory to exist and be available, so we are introducing logic -# here to pick a working HOME -# -# You can find this file in the repo at https://github.com/chef/omnibus-chef - -if !ENV['HOME'] || !File.exists?(ENV['HOME']) - old_home = ENV['HOME'] - found = false - alternate_homes = [] - alternate_homes << "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" if ENV['HOMEDRIVE'] - alternate_homes << "#{ENV['USERPROFILE']}" if ENV['USERPROFILE'] - - alternate_homes.each do |path| - if File.exists?(path) - ENV['HOME'] = path - found = true - break - end - end - - STDERR.puts <<-EOF -The HOME (#{old_home}) environment variable was not set, or was set to -an inaccessible location. Because this can prevent you from running many -of the programs included with ChefDK, we will attempt to find another -suitable location. - - EOF - - if found - STDERR.puts <<-EOF -Falling back to using #{ENV['HOME']} as the home directory. If you would like -to use another directory as HOME, please set the HOME environment variable. - EOF - else - STDERR.puts <<-EOF -Could not find a suitable HOME directory. Tried: -#{alternate_homes.join("\n")} - -Some Ruby binaries may not function correctly. You can set the HOME -environment variable to a directory that exists to try to solve this. - EOF - end - - STDERR.puts <<-EOF - -If you would not like ChefDK to try to fix the HOME environment variable, -check the CHEFDK_ENV_FIX environment variable. Setting this value to 0 -prevent this modification to your HOME environment variable. - - EOF -end diff --git a/omnibus/files/rubygems-customization/default/operating_system.rb b/omnibus/files/rubygems-customization/default/operating_system.rb deleted file mode 100644 index 993e182fe3..0000000000 --- a/omnibus/files/rubygems-customization/default/operating_system.rb +++ /dev/null @@ -1,27 +0,0 @@ -## Rubygems Customization ## -# Customize rubygems install behavior and locations to keep user gems isolated -# from the stuff we bundle with omnibus and any other ruby installations on the -# system. - -# Always install and update new gems in "user install mode" -Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS["install"] = "--user --no-document" -Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS["update"] = "--user --no-document" - -module Gem - - ## - # Override user_dir to live inside of ~/.chefdk - - class << self - # Remove method before redefining so we avoid a ruby warning - remove_method :user_dir - - def user_dir - parts = [Gem.user_home, '.chefdk', 'gem', ruby_engine] - parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty? - File.join parts - end - end - -end - diff --git a/omnibus/files/rubygems-customization/windows/operating_system.rb b/omnibus/files/rubygems-customization/windows/operating_system.rb deleted file mode 100644 index 301b70c4a6..0000000000 --- a/omnibus/files/rubygems-customization/windows/operating_system.rb +++ /dev/null @@ -1,73 +0,0 @@ -## Rubygems Customization ## -# Customize rubygems install behavior and locations to keep user gems isolated -# from the stuff we bundle with omnibus and any other ruby installations on the -# system. - -# Always install and update new gems in "user install mode" -Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS["install"] = "--user" -Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS["update"] = "--user" - -# We will inject our hacks in if the user will allow it. -begin - if (ENV['CHEFDK_ENV_FIX'] || '0').to_i != 0 - require 'chefdk_env_customization' - end -rescue - nil -end - -module Gem - - ## - # Override user_dir to live inside of ~/.chefdk - - def self.user_dir - chefdk_home_set = !([nil, ''].include? ENV['CHEFDK_HOME']) - # We call expand_path here because it converts \ -> / - # Rubygems seems to require that we not use \ - default_home = File.join(File.expand_path(ENV['LOCALAPPDATA']), 'chefdk') - - chefdk_home = if chefdk_home_set - ENV['CHEFDK_HOME'] - else - old_home = File.join(Gem.user_home, '.chefdk') - if File.exists?(old_home) - Gem.ui.alert_warning <<-EOF - - ChefDK now defaults to using #{default_home} instead of #{old_home}. - Since #{old_home} exists on your machine, ChefDK will continue - to make use of it. Please set the environment variable CHEFDK_HOME - to #{old_home} to remove this warning. This warning will be removed - in the next major version bump of ChefDK. - EOF - old_home - else - default_home - end - end - - # Prevents multiple warnings - ENV['CHEFDK_HOME'] = chefdk_home - - parts = [chefdk_home, 'gem', ruby_engine] - parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty? - File.join parts - end - -end - -# :DK-BEG: override 'gem install' to enable RubyInstaller DevKit usage -Gem.pre_install do |gem_installer| - unless gem_installer.spec.extensions.empty? - unless ENV['PATH'].include?('C:\\opscode\\chefdk\\embedded\\mingw\\bin') then - Gem.ui.say 'Temporarily enhancing PATH to include DevKit...' if Gem.configuration.verbose - ENV['PATH'] = 'C:\\opscode\\chefdk\\embedded\\bin;C:\\opscode\\chefdk\\embedded\\mingw\\bin;' + ENV['PATH'] - end - ENV['RI_DEVKIT'] = 'C:\\opscode\\chefdk\\embedded' - ENV['CC'] = 'gcc' - ENV['CXX'] = 'g++' - ENV['CPP'] = 'cpp' - end -end -# :DK-END: - |