From 3aacc2108d122a420698d6d80e9a85ea528c6706 Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Tue, 2 Jun 2020 08:25:35 -0400 Subject: [PATCH 1/2] Remove workarounds --- NuGet.config | 8 -------- src/Directory.Build.targets | 10 +--------- src/Directory.build.props | 1 - 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 NuGet.config diff --git a/NuGet.config b/NuGet.config deleted file mode 100644 index baca44cbf..000000000 --- a/NuGet.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 6760c3c20..12c61a902 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,13 +1,5 @@ - - - $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) - - - - - + latest true true - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb From b9ab6e02e6795dc1fe561144efef365cb343d5be Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Tue, 2 Jun 2020 08:34:14 -0400 Subject: [PATCH 2/2] Add missing doc tag values to fix warnings --- src/Humanizer/HeadingExtensions.cs | 1 + src/Humanizer/InflectorExtensions.cs | 2 -- src/Humanizer/TimeSpanHumanizeExtensions.cs | 2 ++ src/Humanizer/ToQuantityExtensions.cs | 11 ++++++++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Humanizer/HeadingExtensions.cs b/src/Humanizer/HeadingExtensions.cs index 2bb524874..a897427e7 100644 --- a/src/Humanizer/HeadingExtensions.cs +++ b/src/Humanizer/HeadingExtensions.cs @@ -36,6 +36,7 @@ public static class HeadingExtensions /// This representation has a maximum deviation of 11.25 degrees. /// /// A textual representation of the heading + /// The heading value /// The culture to return the textual representation in /// Whether to return a short result or not. public static string ToHeading(this double heading, HeadingStyle style = HeadingStyle.Abbreviated, CultureInfo culture = null) diff --git a/src/Humanizer/InflectorExtensions.cs b/src/Humanizer/InflectorExtensions.cs index 4e0e554ca..42bb8cb5d 100644 --- a/src/Humanizer/InflectorExtensions.cs +++ b/src/Humanizer/InflectorExtensions.cs @@ -68,7 +68,6 @@ public static string Titleize(this string input) /// By default, pascalize converts strings to UpperCamelCase also removing underscores /// /// - /// "This has a space" -> "ThisHasASpace" if true /// public static string Pascalize(this string input) { @@ -79,7 +78,6 @@ public static string Pascalize(this string input) /// Same as Pascalize except that the first character is lower case /// /// - /// "This has a space" -> "thisHasASpace" if true /// public static string Camelize(this string input) { diff --git a/src/Humanizer/TimeSpanHumanizeExtensions.cs b/src/Humanizer/TimeSpanHumanizeExtensions.cs index f02e2b4f5..7ab751898 100644 --- a/src/Humanizer/TimeSpanHumanizeExtensions.cs +++ b/src/Humanizer/TimeSpanHumanizeExtensions.cs @@ -26,6 +26,7 @@ public static class TimeSpanHumanizeExtensions /// The maximum unit of time to output. The default value is . The time units and will give approximations for time spans bigger 30 days by calculating with 365.2425 days a year and 30.4369 days a month. /// The minimum unit of time to output. /// The separator to use when combining humanized time parts. If null, the default collection formatter for the current culture is used. + /// Uses words instead of numbers if true. E.g. one day. /// public static string Humanize(this TimeSpan timeSpan, int precision = 1, CultureInfo culture = null, TimeUnit maxUnit = TimeUnit.Week, TimeUnit minUnit = TimeUnit.Millisecond, string collectionSeparator = ", ", bool toWords = false) { @@ -42,6 +43,7 @@ public static string Humanize(this TimeSpan timeSpan, int precision = 1, Culture /// The maximum unit of time to output. The default value is . The time units and will give approximations for time spans bigger than 30 days by calculating with 365.2425 days a year and 30.4369 days a month. /// The minimum unit of time to output. /// The separator to use when combining humanized time parts. If null, the default collection formatter for the current culture is used. + /// Uses words instead of numbers if true. E.g. one day. /// public static string Humanize(this TimeSpan timeSpan, int precision, bool countEmptyUnits, CultureInfo culture = null, TimeUnit maxUnit = TimeUnit.Week, TimeUnit minUnit = TimeUnit.Millisecond, string collectionSeparator = ", ", bool toWords = false) { diff --git a/src/Humanizer/ToQuantityExtensions.cs b/src/Humanizer/ToQuantityExtensions.cs index ac40dbfba..58c90d0a2 100644 --- a/src/Humanizer/ToQuantityExtensions.cs +++ b/src/Humanizer/ToQuantityExtensions.cs @@ -145,7 +145,16 @@ public static string ToQuantity(this string input, double quantity, string forma return string.Format(formatProvider, "{0} {1}", quantity.ToString(format, formatProvider), transformedInput); } - + + /// + /// Prefixes the provided word with the number and accordingly pluralizes or singularizes the word + /// + /// The word to be prefixed + /// The quantity of the word + /// + /// "request".ToQuantity(0.2) => "0.2 requests" + /// + /// public static string ToQuantity(this string input, double quantity) { return ToQuantity(input, quantity, null, null);