diff --git a/buildnum.properties b/buildnum.properties
index 8ff75c6..f54bac3 100644
--- a/buildnum.properties
+++ b/buildnum.properties
@@ -1,3 +1,3 @@
#ANT Task: ch.oscg.jreleaseinfo.BuildNumberHandler
-#Fri Apr 25 18:08:16 PDT 2014
+#Sat Aug 29 12:08:20 PDT 2015
build.num.last=0
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 3c7abdf..b5166da 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 78e97c5..0196fc2 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat Apr 19 12:47:30 PDT 2014
+#Sat Aug 29 12:01:59 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
diff --git a/mobibot.ipr b/mobibot.ipr
index fdac789..78cb19a 100644
--- a/mobibot.ipr
+++ b/mobibot.ipr
@@ -132,335 +132,46 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
@@ -2144,20 +2241,22 @@
-
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
@@ -2318,11 +2417,13 @@
+
+
-
+
@@ -2345,31 +2446,31 @@
-
+
-
-
-
+
-
-
+
+
+
+
@@ -2395,9 +2496,9 @@
-
-
+
+
@@ -2470,9 +2571,6 @@
-
-
-
@@ -2548,190 +2646,186 @@
-
+
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -2739,98 +2833,77 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
@@ -2838,90 +2911,164 @@
-
+
-
+
+
+
+
-
+
-
+
+
+
+
-
+
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/net/thauvin/erik/mobibot/CurrencyConverter.java b/src/main/java/net/thauvin/erik/mobibot/CurrencyConverter.java
index f5936c9..4996b63 100644
--- a/src/main/java/net/thauvin/erik/mobibot/CurrencyConverter.java
+++ b/src/main/java/net/thauvin/erik/mobibot/CurrencyConverter.java
@@ -98,7 +98,7 @@ public class CurrencyConverter implements Runnable
*/
public final void run()
{
- if (Utils.isValidString(sender) && Utils.isValidString(query))
+ if (Utils.isValidString(sender))
{
if (EXCHANGE_RATES.isEmpty())
{
@@ -140,71 +140,76 @@ public class CurrencyConverter implements Runnable
}
}
- if (!EXCHANGE_RATES.isEmpty())
+ if (EXCHANGE_RATES.isEmpty())
{
- if (query.matches("\\d+([,\\d]+)?(\\.\\d+)? [a-zA-Z]{3}+ to [a-zA-Z]{3}+"))
+ bot.getLogger().debug("The exchange rate table is empty.");
+ bot.send(sender, "Sorry, but the exchange rate table is empty.");
+ }
+ else if (Utils.isValidString(query))
+ {
+ if (!EXCHANGE_RATES.isEmpty())
{
- final String[] cmds = query.split(" ");
-
- if (cmds.length == 4)
+ if (query.matches("\\d+([,\\d]+)?(\\.\\d+)? [a-zA-Z]{3}+ to [a-zA-Z]{3}+"))
{
- if (cmds[3].equals(cmds[1]) || cmds[0].equals("0"))
- {
- bot.send(sender, "You're kidding, right?");
- }
- else
- {
- try
- {
- final double amt = Double.parseDouble(cmds[0].replaceAll(",", ""));
- final double from = Double.parseDouble(EXCHANGE_RATES.get(cmds[1].toUpperCase()));
- final double to = Double.parseDouble(EXCHANGE_RATES.get(cmds[3].toUpperCase()));
+ final String[] cmds = query.split(" ");
- bot.send(bot.getChannel(),
- NumberFormat.getCurrencyInstance(Locale.US).format(amt).substring(1) + ' ' +
- cmds[1].toUpperCase() + " = " +
- NumberFormat.getCurrencyInstance(Locale.US).format((amt * to) / from)
- .substring(1) + ' ' + cmds[3].toUpperCase());
- }
- catch (NullPointerException ignored)
+ if (cmds.length == 4)
+ {
+ if (cmds[3].equals(cmds[1]) || cmds[0].equals("0"))
{
- bot.send(sender, "The supported currencies are: " + EXCHANGE_RATES.keySet().toString());
+ bot.send(sender, "You're kidding, right?");
+ }
+ else
+ {
+ try
+ {
+ final double amt = Double.parseDouble(cmds[0].replaceAll(",", ""));
+ final double from = Double.parseDouble(EXCHANGE_RATES.get(cmds[1].toUpperCase()));
+ final double to = Double.parseDouble(EXCHANGE_RATES.get(cmds[3].toUpperCase()));
+
+ bot.send(bot.getChannel(),
+ NumberFormat.getCurrencyInstance(Locale.US).format(amt).substring(1) + ' '
+ +
+ cmds[1].toUpperCase() + " = " +
+ NumberFormat.getCurrencyInstance(Locale.US).format((amt * to) / from)
+ .substring(1) + ' ' + cmds[3].toUpperCase());
+ }
+ catch (NullPointerException ignored)
+ {
+ bot.send(sender,
+ "The supported currencies are: " + EXCHANGE_RATES.keySet().toString());
+ }
}
}
}
- }
- else if (query.equals(Commands.CURRENCY_RATES_KEYWORD))
- {
- bot.send(sender, "Last Update: " + pubDate);
-
- final Iterator it = EXCHANGE_RATES.keySet().iterator();
- String rate;
-
- final StringBuilder buff = new StringBuilder(0);
-
- while (it.hasNext())
+ else if (query.equals(Commands.CURRENCY_RATES_KEYWORD))
{
- rate = it.next();
- if (buff.length() > 0)
+ bot.send(sender, "Last Update: " + pubDate);
+
+ final Iterator it = EXCHANGE_RATES.keySet().iterator();
+ String rate;
+
+ final StringBuilder buff = new StringBuilder(0);
+
+ while (it.hasNext())
{
- buff.append(", ");
+ rate = it.next();
+ if (buff.length() > 0)
+ {
+ buff.append(", ");
+ }
+ buff.append(rate).append(": ").append(EXCHANGE_RATES.get(rate));
}
- buff.append(rate).append(": ").append(EXCHANGE_RATES.get(rate));
+
+ bot.send(sender, buff.toString());
+
}
-
- bot.send(sender, buff.toString());
-
- }
- else
- {
- bot.helpResponse(sender, Commands.CURRENCY_CMD + ' ' + query);
- bot.send(sender, "The supported currencies are: " + EXCHANGE_RATES.keySet().toString());
}
}
else
{
- bot.getLogger().debug("The exchange rate table is empty.");
- bot.send(sender, "Sorry, but the exchange rate table is empty.");
+ bot.helpResponse(sender, Commands.CURRENCY_CMD + ' ' + query);
+ bot.send(sender, "The supported currencies are: " + EXCHANGE_RATES.keySet().toString());
}
}
}
@@ -215,6 +220,7 @@ public class CurrencyConverter implements Runnable
* @param sender The nick of the person who sent the message.
* @param query The currency query.
*/
+
public synchronized void setQuery(String sender, String query)
{
this.query = query;
diff --git a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java
index 77308f3..c7e510d 100644
--- a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java
+++ b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java
@@ -1211,6 +1211,8 @@ public class Mobibot extends PircBot
if (lcTopic.endsWith(Commands.CURRENCY_CMD))
{
+ send(sender, "For a listing of currency rates:");
+ send(sender, DOUBLE_INDENT + Utils.bold(getNick() + ": " + Commands.CURRENCY_CMD) + ' ' + Commands.CURRENCY_RATES_KEYWORD);
send(sender, "For a listing of supported currencies:");
send(sender, DOUBLE_INDENT + Utils.bold(getNick() + ": " + Commands.CURRENCY_CMD));
}
diff --git a/src/main/java/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/main/java/net/thauvin/erik/mobibot/ReleaseInfo.java
index d17fb03..2b79193 100644
--- a/src/main/java/net/thauvin/erik/mobibot/ReleaseInfo.java
+++ b/src/main/java/net/thauvin/erik/mobibot/ReleaseInfo.java
@@ -1,115 +1,59 @@
-/*
- * ReleaseInfo.java
- *
- * Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * Neither the name of the author nor the names of its contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
-/* Creation date Fri Apr 25 18:08:16 PDT 2014 */
+/* Creation date Sat Aug 29 12:08:20 PDT 2015 */
package net.thauvin.erik.mobibot;
import java.util.Date;
/**
* This class provides information gathered from the build environment.
- *
+ *
* @author JReleaseInfo AntTask
*/
-public class ReleaseInfo
-{
+public class ReleaseInfo {
- /**
- * buildDate (set during build process to 1398474496363L).
- */
- private static final Date buildDate = new Date(1398474496363L);
+ /**
+ * Disables the default constructor.
+ * @throws UnsupportedOperationException if the constructor is called.
+ */
+ private ReleaseInfo() throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Illegal constructor call.");
+ }
- /**
- * project (set during build process to "mobibot").
- */
- private static final String project = "mobibot";
- /**
- * version (set during build process to "0.6").
- */
- private static final String version = "0.6";
+ /** buildDate (set during build process to 1440875300470L). */
+ private static final Date buildDate = new Date(1440875300470L);
- /**
- * Disables the default constructor.
- *
- * @throws UnsupportedOperationException if the constructor is called.
- */
- private ReleaseInfo()
- throws UnsupportedOperationException
- {
- throw new UnsupportedOperationException("Illegal constructor call.");
- }
+ /**
+ * Get buildDate (set during build process to Sat Aug 29 12:08:20 PDT 2015).
+ * @return Date buildDate
+ */
+ public static Date getBuildDate() { return buildDate; }
- /**
- * Get buildDate (set during build process to Fri Apr 25 18:08:16 PDT 2014).
- *
- * @return Date buildDate
- */
- public static Date getBuildDate()
- {
- return buildDate;
- }
- /**
- * Get buildNumber (set during build process to 0).
- *
- * @return int buildNumber
- */
- public static int getBuildNumber()
- {
- return 0;
- }
+ /** project (set during build process to "mobibot"). */
+ private static final String project = "mobibot";
- /**
- * Get project (set during build process to "mobibot").
- *
- * @return String project
- */
- public static String getProject()
- {
- return project;
- }
+ /**
+ * Get project (set during build process to "mobibot").
+ * @return String project
+ */
+ public static String getProject() { return project; }
- /**
- * Get version (set during build process to "0.6").
- *
- * @return String version
- */
- public static String getVersion()
- {
- return version;
- }
+
+ /** version (set during build process to "0.6"). */
+ private static final String version = "0.6";
+
+ /**
+ * Get version (set during build process to "0.6").
+ * @return String version
+ */
+ public static String getVersion() { return version; }
+
+
+ /**
+ * Get buildNumber (set during build process to 0).
+ * @return int buildNumber
+ */
+ public static int getBuildNumber() { return 0; }
}