From 482e4985ec29af24fd5dfaae71a107444641287f Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Tue, 4 Mar 2014 19:03:06 -0700 Subject: [PATCH] do not add editor name to the end of a submission --- src/com/dogcows/Editor.java | 28 +++++++++++++------------- src/com/dogcows/VimCoder.java | 5 ----- src/com/dogcows/resources/C++Template | 2 +- src/com/dogcows/resources/JavaTemplate | 2 +- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/com/dogcows/Editor.java b/src/com/dogcows/Editor.java index ea47442..8740324 100644 --- a/src/com/dogcows/Editor.java +++ b/src/com/dogcows/Editor.java @@ -58,10 +58,10 @@ public class Editor private static final Map languageExtension = new HashMap(); static { - languageExtension.put("Java", "java"); - languageExtension.put("C++", "cc"); - languageExtension.put("C#", "cs"); - languageExtension.put("VB", "vb"); + languageExtension.put("Java", "java"); + languageExtension.put("C++", "cc"); + languageExtension.put("C#", "cs"); + languageExtension.put("VB", "vb"); languageExtension.put("Python", "py"); } @@ -115,16 +115,17 @@ public class Editor // Set up the terms used for the template expansion. HashMap terms = new HashMap(); - terms.put("RETURNTYPE", component.getReturnType().getDescriptor(language)); - terms.put("CLASSNAME", name); - terms.put("METHODNAME", component.getMethodName()); - terms.put("METHODPARAMS", getMethodParams(component.getParamTypes(), + terms.put("RETURNTYPE", component.getReturnType().getDescriptor(language)); + terms.put("CLASSNAME", name); + terms.put("METHODNAME", component.getMethodName()); + terms.put("METHODPARAMS", getMethodParams(component.getParamTypes(), component.getParamNames(), language)); - terms.put("METHODPARAMNAMES", Util.join(component.getParamNames(), ", ")); - terms.put("METHODPARAMSTREAMIN", Util.join(component.getParamNames(), " >> ")); + terms.put("METHODPARAMNAMES", Util.join(component.getParamNames(), ", ")); + terms.put("METHODPARAMSTREAMIN", Util.join(component.getParamNames(), " >> ")); terms.put("METHODPARAMSTREAMOUT", Util.join(component.getParamNames(), " << \", \" << ")); - terms.put("METHODPARAMDECLARES", getMethodParamDeclarations(component.getParamTypes(), - component.getParamNames(), language)); + terms.put("METHODPARAMDECLARES", getMethodParamDeclarations(component.getParamTypes(), + component.getParamNames(), language)); + terms.put("VIMCODER", VimCoder.version); // Write the problem statement as an HTML file in the problem directory. File problemFile = new File(directory, "Problem.html"); @@ -217,8 +218,7 @@ public class Editor */ public String getSource() throws IOException { - return Util.readFile(sourceFile) + "\n// Edited by " + - VimCoder.version + "\n// " + VimCoder.website + "\n\n"; + return Util.readFile(sourceFile); } diff --git a/src/com/dogcows/VimCoder.java b/src/com/dogcows/VimCoder.java index 5841a42..d094394 100644 --- a/src/com/dogcows/VimCoder.java +++ b/src/com/dogcows/VimCoder.java @@ -29,11 +29,6 @@ public class VimCoder */ public final static String version = "VimCoder 0.3.5"; - /** - * The website of the plugin project. - */ - public final static String website = "http://github.com/chazmcgarvey/vimcoder"; - /** * The first part of the command used to invoke the Vim server. diff --git a/src/com/dogcows/resources/C++Template b/src/com/dogcows/resources/C++Template index 1bf6810..6f225cd 100644 --- a/src/com/dogcows/resources/C++Template +++ b/src/com/dogcows/resources/C++Template @@ -1,5 +1,5 @@ -// {{{ Boilerplate Code <-------------------------------------------------- +// {{{ $VIMCODER$ <----------------------------------------------------- // vim:filetype=cpp:foldmethod=marker:foldmarker={{{,}}} #include diff --git a/src/com/dogcows/resources/JavaTemplate b/src/com/dogcows/resources/JavaTemplate index 47ab5db..68c790b 100644 --- a/src/com/dogcows/resources/JavaTemplate +++ b/src/com/dogcows/resources/JavaTemplate @@ -1,5 +1,5 @@ -// {{{ Boilerplate Code <-------------------------------------------------- +// {{{ $VIMCODER$ <----------------------------------------------------- // vim:filetype=java:foldmethod=marker:foldmarker={{{,}}} import static java.lang.Math.*; -- 2.45.2