Commit 66758af7 authored by Fabio Pelosin's avatar Fabio Pelosin

[Config] Restore support for custom repos dir

parent b5cf7cba
...@@ -113,7 +113,7 @@ module Pod ...@@ -113,7 +113,7 @@ module Pod
# @return [Pathname] the directory where the CocoaPods sources are stored. # @return [Pathname] the directory where the CocoaPods sources are stored.
# #
def repos_dir def repos_dir
@repos_dir ||= Pathname.new(ENV['HOME'] + "/.cocoapods") @repos_dir ||= Pathname.new(ENV['CP_REPOS_DIR'] || "~/.cocoapods").expand_path
end end
attr_writer :repos_dir attr_writer :repos_dir
...@@ -165,7 +165,7 @@ module Pod ...@@ -165,7 +165,7 @@ module Pod
# @return [Pathname] The path of the file which contains the user settings. # @return [Pathname] The path of the file which contains the user settings.
# #
def user_settings_file def user_settings_file
Pathname.new(ENV['HOME'] + "/.cocoapods/config.yaml") repos_dir + "config.yaml"
end end
# Sets the values of the attributes with the given hash. # Sets the values of the attributes with the given hash.
......
...@@ -16,6 +16,16 @@ module Pod ...@@ -16,6 +16,16 @@ module Pod
it "returns the path to the spec-repos dir" do it "returns the path to the spec-repos dir" do
config.repos_dir.should == Pathname.new("~/.cocoapods").expand_path config.repos_dir.should == Pathname.new("~/.cocoapods").expand_path
end end
it "returns the path to the spec-repos dir" do
config.repos_dir.should == Pathname.new("~/.cocoapods").expand_path
end
it "allows to specify the repos dir with an environment variable" do
ENV['CP_REPOS_DIR'] = '~/custom_repos_dir'
config.repos_dir.should == Pathname.new("~/custom_repos_dir").expand_path
ENV.delete('CP_REPOS_DIR')
end
end end
describe "Concerning a user's project, which is expected in the current working directory" do describe "Concerning a user's project, which is expected in the current working directory" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment