Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

Commit

Permalink
patch 2.0.0 archive for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
klieber committed Mar 2, 2015
1 parent 1f95aba commit 62a4fd6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/
package com.github.klieber.phantomjs.archive;

import com.github.klieber.phantomjs.util.VersionUtil;

public class MacOSXPhantomJSArchive extends PhantomJSArchive {

public MacOSXPhantomJSArchive(String version) {
Expand All @@ -40,4 +42,9 @@ protected String getPlatform() {
protected String getExecutable() {
return "bin/phantomjs";
}

@Override
public String getPatch() {
return VersionUtil.isEqualTo("2.0.0", this.getVersion()) ? "fix01" : super.getPatch();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
package com.github.klieber.phantomjs.archive;

public abstract class PhantomJSArchive {
private final String basename;

private final String basename;
private final String version;

public PhantomJSArchive(String version) {
Expand All @@ -37,6 +37,8 @@ public PhantomJSArchive(String version) {
protected String getArch() {
return null;
}

protected String getPatch() { return null; }

public final String getArchiveName() {
return this.getArchiveNameSB().toString();
Expand Down Expand Up @@ -78,6 +80,9 @@ public final String getClassifier() {
if (this.getArch() != null) {
sb.append("-").append(this.getArch());
}
if (this.getPatch() != null) {
sb.append("-").append(this.getPatch());
}
return sb.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public static boolean isLessThan(String versionA, String versionB) {
}

public static boolean isEqualTo(String versionA, String versionB) {
return compare(versionA, versionB) < 0;
return compare(versionA, versionB) == 0;
}
}

0 comments on commit 62a4fd6

Please sign in to comment.