diff --git a/build.gradle b/build.gradle index 2b9cf61..5bb7906 100644 --- a/build.gradle +++ b/build.gradle @@ -73,7 +73,7 @@ tasks.withType(SpotBugsTask) { xml.enabled = false html.enabled = true } - excludeFilter = file("config/spotbugs/excludeFilter.xml") + excludeFilter = file("$projectDir/config/spotbugs/excludeFilter.xml") } compileJava { diff --git a/config/spotbugs/excludefilter.xml b/config/spotbugs/excludeFilter.xml similarity index 100% rename from config/spotbugs/excludefilter.xml rename to config/spotbugs/excludeFilter.xml diff --git a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java index 35020ee..bce378d 100644 --- a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java +++ b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java @@ -18,12 +18,12 @@ public final class ReleaseInfo { public final static String PROJECT = "mobibot"; public final static LocalDateTime BUILDDATE = - LocalDateTime.ofInstant(Instant.ofEpochMilli(1531553255553L), ZoneId.systemDefault()); + LocalDateTime.ofInstant(Instant.ofEpochMilli(1531606310641L), ZoneId.systemDefault()); public final static int MAJOR = 0; public final static int MINOR = 7; public final static int PATCH = 3; public final static String PRERELEASE = "beta"; - public final static String BUILDMETA = "006"; + public final static String BUILDMETA = "009"; /** * The full version string. diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Weather2.java b/src/main/java/net/thauvin/erik/mobibot/modules/Weather2.java index 6fc8c80..bf75a43 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/Weather2.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/Weather2.java @@ -80,6 +80,17 @@ public class Weather2 extends AbstractModule { return Math.round(d) + " \u00B0F, " + Math.round(c) + " \u00B0C"; } + private OWM.Country getCountry(String countryCode) { + for (OWM.Country c : OWM.Country.values()) { + if (c.name().equalsIgnoreCase(countryCode)) { + return c; + } + + } + + return OWM.Country.UNITED_STATES; + } + /** * {@inheritDoc} */ @@ -90,7 +101,7 @@ public class Weather2 extends AbstractModule { bot.send(sender, "For example:"); bot.send(sender, bot.helpIndent(bot.getNick() + ": " + WEATHER_CMD + " paris, fr")); bot.send(sender, "The default ISO 3166 country code is " + Utils.bold("US") - + ". Zip codes are supported in the US."); + + ". Zip codes are supported in most countries."); } /** @@ -122,7 +133,7 @@ public class Weather2 extends AbstractModule { try { final CurrentWeather cwd; if (city.matches("\\d+")) { - cwd = owm.currentWeatherByZipCode(Integer.parseInt(city), OWM.Country.UNITED_STATES); + cwd = owm.currentWeatherByZipCode(Integer.parseInt(city), getCountry(country)); } else { cwd = owm.currentWeatherByCityName(city, getCountry(country)); } @@ -184,15 +195,4 @@ public class Weather2 extends AbstractModule { final double kmh = w * 1.60934; return Math.round(w) + " mph, " + Math.round(kmh) + " km/h"; } - - private OWM.Country getCountry(String countryCode) { - for (OWM.Country c : OWM.Country.values()) { - if (c.name().equalsIgnoreCase(countryCode)) { - return c; - } - - } - - return OWM.Country.UNITED_STATES; - } } diff --git a/version.properties b/version.properties index 02ca2fa..223b738 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ #Generated by the Semver Plugin for Gradle -#Sat Jul 14 00:27:34 PDT 2018 -version.buildmeta=006 +#Sat Jul 14 15:11:49 PDT 2018 +version.buildmeta=009 version.major=0 version.minor=7 version.patch=3