Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ This is an example of GitBucket plug-in. This plug-in provides code snippet repo
## Instllation

1. Hit `./sbt.sh package` in the root directory of this repository.
2. Copy `target/scala-2.11/gitbucket-gist-plugin_2.11-1.1.jar` into `GITBUCKET_HOME/plugins`.
2. Copy `target/scala-2.11/gitbucket-gist-plugin_2.11-1.2.jar` into `GITBUCKET_HOME/plugins`.
3. Restart GitBucket.
8 changes: 4 additions & 4 deletions project/build.scala
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ object MyBuild extends Build {

val Organization = "jp.sf.amateras"
val Name = "gitbucket-gist-plugin"
val Version = "1.1"
val ScalaVersion = "2.11.2"
val Version = "1.2"
val ScalaVersion = "2.11.6"

lazy val project = Project (
"gitbucket-gist-plugin",
Expand All @@ -25,8 +25,8 @@ object MyBuild extends Build {
"amateras-repo" at "http://amateras.sourceforge.jp/mvn/"
),
libraryDependencies ++= Seq(
"gitbucket" % "gitbucket-assembly" % "3.1.1" % "provided",
"com.typesafe.play" %% "twirl-compiler" % "1.0.2" % "provided",
"gitbucket" % "gitbucket-assembly" % "3.2.0" % "provided",
"com.typesafe.play" %% "twirl-compiler" % "1.0.4" % "provided",
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided"
),
javacOptions in compile ++= Seq("-target", "7", "-source", "7")
Expand Down
11 changes: 5 additions & 6 deletions src/main/scala/Plugin.scala
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import gitbucket.core.service.SystemSettingsService
import gitbucket.core.service.SystemSettingsService.SystemSettings
import gitbucket.gist.controller.GistController
import gitbucket.core.plugin.PluginRegistry
import gitbucket.core.util.Version
import java.io.File
import javax.servlet.ServletContext
import gitbucket.gist.util.Configurations._

class Plugin extends gitbucket.core.plugin.Plugin with SystemSettingsService {
class Plugin extends gitbucket.core.plugin.Plugin {
override val pluginId: String = "gist"
override val pluginName: String = "Gist Plugin"
override val description: String = "Provides Gist feature on GitBucket."
override val versions: List[Version] = List(Version(1, 0))
override val versions: List[Version] = List(Version(1, 2))

override def initialize(registry: PluginRegistry, context: ServletContext): Unit = {
override def initialize(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Unit = {
// Add Snippet link to the header
val settings = loadSystemSettings()
val path = settings.baseUrl.getOrElse(context.getContextPath)
registry.addJavaScript(".*",
s"""
Expand Down Expand Up @@ -43,6 +42,6 @@ class Plugin extends gitbucket.core.plugin.Plugin with SystemSettingsService {
println("-- Gist plug-in initialized --")
}

override def shutdown(registry: PluginRegistry, context: ServletContext): Unit = {
override def shutdown(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Unit = {
}
}