Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
oyse committed Oct 4, 2014
2 parents fd69832 + d469cf8 commit bed8026
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 8 deletions.
4 changes: 2 additions & 2 deletions org.dadacoalition.yedit.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.dadacoalition.yedit"
label="YEdit Feature"
version="1.0.15"
version="1.0.16"
provider-name="YEdit Project">

<description>
Expand Down Expand Up @@ -118,7 +118,7 @@ This Agreement is governed by the laws of the State of New York and the intellec
id="org.dadacoalition.yedit"
download-size="0"
install-size="0"
version="1.0.15"
version="1.0.16"
unpack="false"/>

</feature>
2 changes: 1 addition & 1 deletion org.dadacoalition.yedit.update/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<description url="http://dadacoalition.org/yedit">
YEdit is an editor for editing YAML files. It is implemented as an Eclipse plugin.
</description>
<feature url="features/org.dadacoalition.yedit_1.0.15.jar" id="org.dadacoalition.yedit" version="1.0.15">
<feature url="features/org.dadacoalition.yedit_1.0.16.jar" id="org.dadacoalition.yedit" version="1.0.16">
<category name="YEdit"/>
</feature>
<category-def name="YEdit" label="YEdit"/>
Expand Down
5 changes: 2 additions & 3 deletions org.dadacoalition.yedit/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: YEdit YAML editor
Bundle-SymbolicName: org.dadacoalition.yedit;singleton:=true
Bundle-Version: 1.0.15
Bundle-Version: 1.0.16
Bundle-Activator: org.dadacoalition.yedit.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Expand All @@ -11,8 +11,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.views,
org.eclipse.core.resources,
org.eclipse.ui.ide,
org.eclipse.ui.workbench.texteditor,
org.apache.commons.lang;bundle-version="2.6.0"
org.eclipse.ui.workbench.texteditor
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.dadacoalition.yedit;uses:="org.eclipse.ui.plugin,org.osgi.framework",
Expand Down
40 changes: 40 additions & 0 deletions org.dadacoalition.yedit/src/org/dadacoalition/yedit/Utils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.dadacoalition.yedit;

import java.util.Collection;

/**
* Various utility functions.
*/
public class Utils {

private Utils(){}

/**
* Join each element in a collection using a string separator
* @param collection The collection to join
* @param separator The separator to use
* @return A string where the toString method on each object in the collection has been called and each element is
* separated with the separator string.
*/
public static String joinAsString(Collection<? extends Object> collection, String separator){

if(collection.isEmpty()){
return "";
}

StringBuilder result = new StringBuilder();
boolean first = true;
for( Object o : collection ){

if(first){
first = false;
} else {
result.append(separator);
}
result.append(o.toString());

}
return result.toString();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.dadacoalition.yedit.Utils;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.DumperOptions.FlowStyle;
import org.yaml.snakeyaml.DumperOptions.ScalarStyle;
Expand Down Expand Up @@ -86,7 +86,7 @@ public String formatDocuments(Iterable<Object> documents){
if( formattedDocuments.isEmpty()){
return formatDocument(null);
} else {
return StringUtils.join(formattedDocuments, System.lineSeparator());
return Utils.joinAsString(formattedDocuments, System.lineSeparator());
}
}

Expand Down

0 comments on commit bed8026

Please sign in to comment.