]> source.dussan.org Git - sonarqube.git/commitdiff
Remove unused RubyTextService
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 18 Jan 2017 17:32:56 +0000 (18:32 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 18 Jan 2017 19:47:59 +0000 (20:47 +0100)
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
server/sonar-server/src/main/java/org/sonar/server/text/RubyTextService.java [deleted file]
server/sonar-server/src/test/java/org/sonar/server/text/RubyTextServiceTest.java [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/models/api/utils.rb
server/sonar-web/src/main/webapp/WEB-INF/app/models/internal.rb
server/sonar-web/src/main/webapp/WEB-INF/app/models/issue.rb

index 2630320711ee3a715c7b0bbd5a6917a8ca33d77e..4413a3e512e20367b2635526df57d2b73fc97e5d 100644 (file)
@@ -190,7 +190,6 @@ import org.sonar.server.test.index.TestIndexer;
 import org.sonar.server.test.ws.CoveredFilesAction;
 import org.sonar.server.test.ws.TestsWs;
 import org.sonar.server.text.MacroInterpreter;
-import org.sonar.server.text.RubyTextService;
 import org.sonar.server.ui.PageDecorations;
 import org.sonar.server.ui.PageRepository;
 import org.sonar.server.ui.DeprecatedViews;
@@ -434,7 +433,6 @@ public class PlatformLevel4 extends PlatformLevel {
 
       // text
       MacroInterpreter.class,
-      RubyTextService.class,
 
       // Notifications
       NotificationModule.class,
diff --git a/server/sonar-server/src/main/java/org/sonar/server/text/RubyTextService.java b/server/sonar-server/src/main/java/org/sonar/server/text/RubyTextService.java
deleted file mode 100644 (file)
index 29f644a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.text;
-
-import org.sonar.api.server.ServerSide;
-import org.sonar.markdown.Markdown;
-
-/**
- * @since 3.6
- */
-@ServerSide
-public class RubyTextService {
-
-  private final MacroInterpreter macroInterpreter;
-
-  public RubyTextService(MacroInterpreter macroInterpreter) {
-    this.macroInterpreter = macroInterpreter;
-  }
-
-  // TODO add ruby example
-  public String interpretMacros(String text) {
-    return macroInterpreter.interpret(text);
-  }
-
-  // TODO add ruby example
-  public String markdownToHtml(String markdown) {
-    return Markdown.convertToHtml(markdown);
-  }
-}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/text/RubyTextServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/text/RubyTextServiceTest.java
deleted file mode 100644 (file)
index 80d151e..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.text;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-public class RubyTextServiceTest {
-
-  MacroInterpreter macroInterpreter = mock(MacroInterpreter.class);
-  RubyTextService text = new RubyTextService(macroInterpreter);
-
-  @Test
-  public void interpretMacros() {
-    text.interpretMacros("text with macros");
-    verify(macroInterpreter, times(1)).interpret("text with macros");
-  }
-
-  @Test
-  public void markdownToHtml() {
-    String html = text.markdownToHtml("some *markdown*");
-    assertThat(html).isEqualTo("some <strong>markdown</strong>");
-  }
-
-  @Test
-  public void should_escape_markdown_input() {
-    String html = text.markdownToHtml("a > b");
-    assertThat(html).isEqualTo("a &gt; b");
-  }
-}
index e07144d3c1ffc754e5d36f4f03d5ed25b3f81b90..221a7d257e527c6df70c85455bfcbca9c20c2949 100644 (file)
@@ -115,10 +115,6 @@ class Api::Utils
     false
   end
 
-  def self.markdown_to_html(markdown='')
-    Internal.text.markdownToHtml(markdown)
-  end
-
   # Splits a string into an array of lines
   # For history reference:
   #   - http://jira.sonarsource.com/browse/SONAR-2282 first modified the behaviour to keep the trailing lines
index 8bbf4897aaa25dca828153d703c404142c4e2730..e0f5c76376fb3311a2dc4089c08d1abc974cb48e 100644 (file)
@@ -26,10 +26,6 @@ class Internal
     component(Java::OrgSonarServerIssue::InternalRubyIssueService.java_class)
   end
 
-  def self.text
-    component(Java::OrgSonarServerText::RubyTextService.java_class)
-  end
-
   def self.users_api
     component(Java::OrgSonarApiUser::RubyUserService.java_class)
   end
index 9a3ca087188d6ad3f77eb5e2d3738900a783a6db..a763d0fdedc4de47f8a41ca73f86ae25f6bb34e3 100644 (file)
 
 class Issue
 
-  def self.comment_to_hash(comment)
-    {
-        :key => comment.key(),
-        :login => comment.userLogin(),
-        :htmlText => Internal.text.markdownToHtml(comment.markdownText()),
-        :createdAt => Api::Utils.format_datetime(comment.createdAt())
-    }
-  end
-
 end