forked from larsch/ocra
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored Host module into HostConfigHelper and updated usage
- Moved the Host module to a separate file as HostConfigHelper. - Updated Ocran to extend HostConfigHelper.
- Loading branch information
Showing
2 changed files
with
59 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require "rbconfig" | ||
|
||
module Ocran | ||
# Variables describing the host's build environment. | ||
module HostConfigHelper | ||
module_function | ||
|
||
def exec_prefix | ||
@exec_prefix ||= Pathname.new(RbConfig::CONFIG["exec_prefix"]) | ||
end | ||
|
||
def sitelibdir | ||
@sitelibdir ||= Pathname.new(RbConfig::CONFIG["sitelibdir"]) | ||
end | ||
|
||
def bindir | ||
@bindir ||= Pathname.new(RbConfig::CONFIG["bindir"]) | ||
end | ||
|
||
def libruby_so | ||
@libruby_so ||= Pathname.new(RbConfig::CONFIG["LIBRUBY_SO"]) | ||
end | ||
|
||
def exe_extname | ||
RbConfig::CONFIG["EXEEXT"] || ".exe" | ||
end | ||
|
||
def rubyw_exe | ||
@rubyw_exe ||= (RbConfig::CONFIG["rubyw_install_name"] || "rubyw") + exe_extname | ||
end | ||
|
||
def ruby_exe | ||
@ruby_exe ||= (RbConfig::CONFIG["ruby_install_name"] || "ruby") + exe_extname | ||
end | ||
end | ||
end |