-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable cache file name #49
Changes from 4 commits
07896e1
2972fb3
c7d9144
2f403de
7cf91eb
504652c
937aaf4
69cb7a6
4137cde
d914e45
e59b530
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,11 @@ | |
--> | ||
<add key="packagesPath" value="" /> | ||
|
||
<!-- | ||
Change the name of the internal cache file. Default is machine name (System.Environment.MachineName). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's unclear whether putting a path here works (or even should work). I would recommend updated the XML comment to state that this must be a file name and not a relative or absolute path. Additionally, I would validate at runtime that this is just a file name. In the future we could extend this to support relative paths but that seems unnecessary now and can be expanded without being a breaking change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. I updated the XML comment and added validation of a valid file name. |
||
--> | ||
<add key="cacheFileName" value="" /> | ||
|
||
<!-- | ||
Set allowOverrideExistingPackageOnPush to false to mimic NuGet.org's behaviour (do not allow overwriting packages with same id + version). | ||
--> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ namespace NuGet.Server.Core.Tests.Infrastructure | |
{ | ||
class FuncSettingsProvider : ISettingsProvider | ||
{ | ||
readonly Func<string, bool, bool> _getSetting; | ||
internal FuncSettingsProvider(Func<string,bool,bool> getSetting) | ||
readonly Func<string, object, object> _getSetting; | ||
internal FuncSettingsProvider(Func<string,object,object> getSetting) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpic: spaces between type parameters after the comma |
||
{ | ||
if (getSetting == null) | ||
{ | ||
|
@@ -20,7 +20,12 @@ internal FuncSettingsProvider(Func<string,bool,bool> getSetting) | |
|
||
public bool GetBoolSetting(string key, bool defaultValue) | ||
{ | ||
return _getSetting(key, defaultValue); | ||
return Convert.ToBoolean(_getSetting(key, defaultValue)); | ||
} | ||
|
||
public string GetStringSetting(string key, string defaultValue) | ||
{ | ||
return Convert.ToString(_getSetting(key, defaultValue)); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: curly
{
}
around all if blocks, even if one line.