guardian/feature-switching — pull request #5 by paulmr (2014-10-15 16:57:40+00:00)
Title: separate out the scalatra dependant code into a separate deliverable

I have split this into two projects, a core part which contains all of the code which doesn't require Scalatra, and a 'scalatra' project which contains the rest.
As part of this, I have made useful traits like the Cookie Override more generic, so that you only need to supply the methods that will get and set a cookie, and you can inherit the implementations of the rest.
I have also bumped up the version as this is not a binary compatible change, and so clients of this library will need to make some minor changes if they want to keep using it.
For example, a patch like this would allow Flex to build with the new version and otherwise behave the same as it does now:

diff --git a/flexible-content-admin/build.sbt b/flexible-content-admin/build.sbt
index 6306c0d..65c8d89 100644
--- a/flexible-content-admin/build.sbt
+++ b/flexible-content-admin/build.sbt
@@ -11 +11 @@ libraryDependencies ++= Seq(
- "com.gu" %% "feature-switching" % "0.11",
+ "com.gu" %% "feature-switching-scalatra" % "0.13-SNAPSHOT",
diff --git a/flexible-content-admin/src/main/scala/com/gu/flexiblecontent/admin/dispatcher/FeatureSwitchingDispatcher.scala b/flexible-content-admin/src/main/scala/com/gu/flexiblecontent/admin/dispatcher/FeatureSwitchingDispatcher.scala
index 9dae118..1fac127 100644
--- a/flexible-content-admin/src/main/scala/com/gu/flexiblecontent/admin/dispatcher/FeatureSwitchingDispatcher.scala
+++ b/flexible-content-admin/src/main/scala/com/gu/flexiblecontent/admin/dispatcher/FeatureSwitchingDispatcher.scala
@@ -4 +4 @@ import com.gu.featureswitching.dispatcher.FeatureSwitchDispatcher
-import com.gu.featureswitching.{InMemoryFeatureSwitchEnablingStrategy, CookieFeatureSwitchingOverrideStrategy}
+import com.gu.featureswitching.{InMemoryFeatureSwitchEnablingStrategy, ScalatraCookieFeatureSwitchingOverrideStrategy}
@@ -11 +11 @@ class FeatureSwitchingDispatcher extends FeatureSwitchDispatcher
- with InMemoryFeatureSwitchEnablingStrategy with CookieFeatureSwitchingOverrideStrategy
+ with InMemoryFeatureSwitchEnablingStrategy with ScalatraCookieFeatureSwitchingOverrideStrategy