Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
fix issue #3 Update for yard parser used in CIQ 2.1.5
Browse files Browse the repository at this point in the history
Update plugin to version to 0.3.3
  • Loading branch information
liias committed Oct 25, 2016
1 parent 2a142b5 commit ac95953
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

#### 0.3.3
* Fix adding SDK 2.1.5 (issue #3)

#### 0.3.2
* Potential fix for issue #2 (running in simulator on mac)
* Allow to set minimum target SDK version for module, used when compiling
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=monkey
ideaVersion=2016.2.3
ideaVersion=2016.2.5
javaVersion=1.8
downloadIdeaSources=true

pluginVersion=0.3.2
pluginVersion=0.3.3

publishUsername=user
publishPassword=password
Expand Down
5 changes: 2 additions & 3 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
]]></description>

<change-notes><![CDATA[
<p>0.3.2</p>
<p>0.3.3</p>
<ul>
<li>Potential fix for issue #2 (running in simulator on mac)</li>
<li>Allow to set minimum target SDK version for module, used when compiling</li>
<li>Fix adding SDK 2.1.5 (issue #3)</li>
</ul>
<a href="https://github.com/liias/monkey/blob/master/CHANGELOG.md#changelog">Full change log...</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,33 @@ private void addMethod(SdkModuleOrClass moduleOrClass, Element methodEl) {
String methodName = signatureEl.select("strong").text();
SdkMethod sdkMethod = new SdkMethod(methodName);

String validParamsStr = signatureEl.ownText().substring(4).trim();
// pre 2.1.5:
// - (<tt>Object</tt>) <strong>switchToView</strong>(view, delegate, transition)
// "- () (view, delegate, transition)"
// "() (view, delegate, transition)"

// since 2.1.5:
// #<strong>switchToView</strong>(view, delegate, transition) ⇒ <tt>Object</tt>
// "#(view, delegate, transition) ⇒ "
// "(view, delegate, transition)"

String paramNames = signatureEl.ownText()
.replace("-", "")
.replace("#", "")
.replace("⇒", "")
.trim();

int iLeftP = paramNames.lastIndexOf("(");
int iRightP = paramNames.lastIndexOf(")");
Set<String> validParamNames = new HashSet<>();
if (!validParamsStr.isEmpty()) {
String[] validParams = validParamsStr.substring(1, validParamsStr.length() - 1).split(",");
for (String validParam : validParams) {
validParamNames.add(validParam.trim());

if (iLeftP != -1 && iRightP != -1) {
String validParamsStr = paramNames.substring(iLeftP + 1, iRightP);
if (!validParamsStr.isEmpty()) {
String[] validParams = validParamsStr.split(",");
for (String validParam : validParams) {
validParamNames.add(validParam.trim());
}
}
}

Expand Down

0 comments on commit ac95953

Please sign in to comment.