-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed finding global rakefiles when no project available. Fixed nosea…
…rch / global search issues.
- Loading branch information
1 parent
ca502bb
commit f29ae0a
Showing
5 changed files
with
118 additions
and
64 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 @@ | ||
Dummy file to give the directory some content. |
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,28 @@ | ||
module InEnvironment | ||
private | ||
|
||
# Create an environment for a test. At the completion of the yielded | ||
# block, the environment is restored to its original conditions. | ||
def in_environment(settings) | ||
original_dir = Dir.pwd | ||
original_settings = set_env(settings) | ||
yield | ||
ensure | ||
set_env(original_settings) | ||
end | ||
|
||
# Set the environment according to the settings hash. | ||
def set_env(settings) # :nodoc: | ||
result = {} | ||
settings.each do |k, v| | ||
result[k] = ENV[k] | ||
if k == 'PWD' | ||
Dir.chdir(v) | ||
else | ||
ENV[k] = v | ||
end | ||
end | ||
result | ||
end | ||
|
||
end |
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