Skip to content

Commit a6c772b

Browse files
authored
Merge pull request #44 from gitbucket/scalatra-2.6
Update for Scalatra 2.6
2 parents f1ddc35 + 215a44a commit a6c772b

File tree

5 files changed

+17
-23
lines changed

5 files changed

+17
-23
lines changed

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ This is a GitBucket plug-in which provides code snippet repository like Gist.
44

55
Plugin version | GitBucket version
66
:--------------|:--------------------
7-
4.10.x | 4.15.x -
8-
4.9.x | 4.14.x -
7+
4.11.x | 4.19.x -
8+
4.10.x | 4.15.x - 4.18.x
9+
4.9.x | 4.14.x
910
4.8.x | 4.11.x - 4.13.x
1011
4.7.x | 4.11.x
1112
4.6.x | 4.10.x
@@ -36,6 +37,8 @@ See [Connect to H2 database](https://github.com/gitbucket/gitbucket/wiki/Connect
3637

3738
## Build from source
3839

39-
1. Install sbt and hit `sbt package` in the root directory of this repository.
40-
2. Copy `target/scala-2.12/gitbucket-gist-plugin_2.12-x.x.x.jar` into `GITBUCKET_HOME/plugins`.
41-
3. Restart GitBucket.
40+
1. Install sbt and hit `sbt assembly` in the root directory of this repository.
41+
2. Copy `target/scala-2.12/gitbucket-gist-plugin-assembly-x.x.x.jar` into `GITBUCKET_HOME/plugins`.
42+
3. GitBucket restarts automatically.
43+
44+
or you can build and install by just hitting `sbt install`.

build.sbt

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
val Organization = "io.github.gitbucket"
2-
val ProjectName = "gitbucket-gist-plugin"
3-
val ProjectVersion = "4.10.0"
4-
val GitBucketVersion = Option(System.getProperty("gitbucket.version")).getOrElse("4.18.0")
5-
6-
lazy val root = (project in file(".")).enablePlugins(SbtTwirl)
7-
8-
organization := Organization
9-
name := ProjectName
10-
version := ProjectVersion
1+
organization := "io.github.gitbucket"
2+
name := "gitbucket-gist-plugin"
3+
version := "4.11.0"
114
scalaVersion := "2.12.4"
12-
13-
libraryDependencies ++= Seq(
14-
"io.github.gitbucket" %% "gitbucket" % GitBucketVersion % "provided",
15-
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided"
16-
)
5+
gitbucketVersion := Option(System.getProperty("gitbucket.version")).getOrElse("4.19.0")
176

187
scalacOptions := Seq("-deprecation", "-feature", "-language:postfixOps")
198
javacOptions in compile ++= Seq("-target", "8", "-source", "8")

project/plugins.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
logLevel := Level.Warn
22

33
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.3.12")
4+
addSbtPlugin("io.github.gitbucket" % "sbt-gitbucket-plugin" % "1.2.0")

src/main/scala/Plugin.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class Plugin extends gitbucket.core.plugin.Plugin {
3232
new Version("4.8.0"),
3333
new Version("4.9.0"),
3434
new Version("4.9.1"),
35-
new Version("4.10.0")
35+
new Version("4.10.0"),
36+
new Version("4.11.0")
3637
)
3738

3839
override def initialize(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Unit = {

src/main/scala/gitbucket/gist/controller/GistController.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package gitbucket.gist.controller
22

33
import java.io.File
44
import gitbucket.core.view.helpers
5-
import io.github.gitbucket.scalatra.forms._
5+
import org.scalatra.forms._
66

77
import gitbucket.core.controller.ControllerBase
88
import gitbucket.core.service.AccountService
@@ -193,7 +193,7 @@ trait GistControllerBase extends ControllerBase {
193193
case Right((revisions, hasNext)) => {
194194
val commits = revisions.map { revision =>
195195
defining(JGitUtil.getRevCommitFromId(git, git.getRepository.resolve(revision.id))){ revCommit =>
196-
JGitUtil.getDiffs(git, revision.id, false) match { case (diffs, oldCommitId) =>
196+
JGitUtil.getDiffs(git, revision.id, true) match { case (diffs, oldCommitId) =>
197197
(revision, diffs)
198198
}
199199
}

0 commit comments

Comments
 (0)