diff options
author | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2016-02-04 13:39:17 -0500 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2016-02-04 21:37:12 -0500 |
commit | d037e0d80699989dfe218b6bb12c8e68cc64459a (patch) | |
tree | 3457287a4b22b35050239cafb63ca96fd3b3a5fc /omnibus | |
parent | e0de2e03860d659b80807a85a4a7d5422aabf5a8 (diff) | |
download | chef-d037e0d80699989dfe218b6bb12c8e68cc64459a.tar.gz |
Allow __FILE__ to be read inside instance_eval
Diffstat (limited to 'omnibus')
-rw-r--r-- | omnibus/config/projects/chef-fips.rb | 3 | ||||
-rw-r--r-- | omnibus/config/projects/chef.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/omnibus/config/projects/chef-fips.rb b/omnibus/config/projects/chef-fips.rb index e9a74fc922..d8c6c79c91 100644 --- a/omnibus/config/projects/chef-fips.rb +++ b/omnibus/config/projects/chef-fips.rb @@ -18,7 +18,8 @@ # This is the chef client build with FIPS mode enabled. # It's a stub for now and produces identical results # -chef_project_contents = IO.read(File.expand_path("../chef.rb", __FILE__)) +current_file = __FILE__ +chef_project_contents = IO.read(File.expand_path("../chef.rb", current_file)) self.instance_eval chef_project_contents name "chef-fips" diff --git a/omnibus/config/projects/chef.rb b/omnibus/config/projects/chef.rb index 6a0f5eb96e..1dde5cfe85 100644 --- a/omnibus/config/projects/chef.rb +++ b/omnibus/config/projects/chef.rb @@ -20,7 +20,8 @@ maintainer "Chef Software, Inc. <maintainers@chef.io>" homepage "https://www.chef.io" build_iteration 1 -version_file = File.expand_path("../../../../VERSION", __FILE__) +current_file ||= __FILE__ +version_file = File.expand_path("../../../../VERSION", current_file) build_version IO.read(version_file).strip if windows? |