Skip to content

Commit 0e9f110

Browse files
committed
release/1.0.0
2 parents 2c9ab75 + f1f9869 commit 0e9f110

25 files changed

+311
-304
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: scala
2+
dist: trusty
23
scala:
34
- 2.11.12
45
- 2.12.8

CHANGELOG

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
Version 1.0.0 (2019-10-31)
2+
--------------------------
3+
Provide a way to create a Parser using cats.Eval (#67)
4+
Abstract over Parser creation (#72)
5+
Expose Medium in Referer (#71)
6+
Do not double decode query string (#73)
7+
Re-establish the ParseTest suite (#74)
8+
(Scala) Allow 'android-app' URL scheme (#90)
9+
Update README to reflect 0.6.0 changes (#88)
10+
Use sbt-tpolecat (#62)
11+
Bump version to 1.0.0 (#92)
12+
Bump cats-core to 1.6.0 (#63)
13+
Bump cats-effect to 1.2.0 (#64)
14+
Bump circe to 0.11.1 (#65)
15+
Bump specs2 to 4.4.1 (#66)
16+
Bump SBT to 1.2.8 (#68)
17+
Change Travis distribution to Trusty (#87)
18+
Fix artifact name in README (#85)
19+
Fix typo in Parser comment (#86)
20+
Modify Gitter badge (#58)
21+
Extend copyright to 2019 (#69)
22+
123
Version 0.5.0 (2019-01-08)
224
--------------------------
325
Make the Medium enumeration public (#47)

LICENSE-2.0.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright [yyyy] [name of copyright owner]
190+
Copyright 2012-2019 Snowplow Analytics Ltd.
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.
@@ -199,4 +199,4 @@
199199
distributed under the License is distributed on an "AS IS" BASIS,
200200
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201201
See the License for the specific language governing permissions and
202-
limitations under the License.
202+
limitations under the License.

README.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# referer-parser Scala library
22

33
[![Build Status](https://travis-ci.org/snowplow-referer-parser/scala-referer-parser.svg?branch=develop)](https://travis-ci.org/snowplow-referer-parser/scala-referer-parser)
4-
[![Join the chat at https://gitter.im/snowplow-referer-parser/referer-parser](https://badges.gitter.im/snowplow-referer-parser/referer-parser.svg)](https://gitter.im/snowplow-referer-parser/referer-parser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4+
[![Gitter](https://badges.gitter.im/snowplow-referer-parser/scala-referer-parser.svg)](https://gitter.im/snowplow-referer-parser/scala-referer-parser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge)
55
[![codecov](https://codecov.io/gh/snowplow-referer-parser/scala-referer-parser/branch/develop/graph/badge.svg)](https://codecov.io/gh/snowplow-referer-parser/scala-referer-parser)
66

77
This is the Scala implementation of [referer-parser][referer-parser], the library for extracting attribution data from referer _(sic)_ URLs.
@@ -10,12 +10,20 @@ The implementation uses a JSON version of the shared 'database' of known referer
1010

1111
The Scala implementation is a core component of [Snowplow][snowplow], the open-source web-scale analytics platform.
1212

13+
### Installation
14+
15+
You can add the following to your SBT config:
16+
17+
```scala
18+
val refererParser = "com.snowplowanalytics" %% "scala-referer-parser" % "1.0.0"
19+
```
20+
1321
### Usage
1422

15-
All effects within the Scala implementation are wrapped in `Sync` from [cats-effect][cats-effect]. In these examples we use `IO`, but anything that implements `Sync` can be used.
23+
You can provide wrappers for effects, such as `Sync`, `Eval` or `Id` from [cats-effect][cats-effect]. In the examples below we use `IO`.
1624

1725
```scala
18-
import com.snowplowanalytics.refererparser.Parser
26+
import com.snowplowanalytics.refererparser._
1927
import cats.effect.IO
2028
import cats.data.EitherT
2129
import java.net.URI
@@ -27,14 +35,14 @@ val referersJsonPath = "/opt/referers/referers.json"
2735

2836
// We use EitherT to handle exceptions. The IO routine will short circuit if an exception is returned.
2937
val io: EitherT[IO, Exception, Unit] = for {
30-
// We can instantiate a new Parse instance with Parse.create
31-
parser <- EitherT(Parser.create[IO](referersJsonPath))
38+
// We can instantiate a new Parser instance with Parser.create
39+
parser <- EitherT(CreateParser[IO].create(referersJsonPath))
3240

3341
// Referer is a sealed hierarchy of different referer types
3442
referer1 <- EitherT.fromOption[IO](parser.parse(refererUrl, pageUrl),
3543
new Exception("No parseable referer"))
3644
_ <- EitherT.right(IO { println(referer1) })
37-
// => SearchReferer(Google, Some(gateway oracle cards denise linn))
45+
// => SearchReferer(SearchMedium,Google,Some(gateway oracle cards denise linn))
3846

3947
// You can provide a list of domains which should be considered internal
4048
referer2 <- EitherT.fromOption[IO](parser.parse(
@@ -43,8 +51,7 @@ val io: EitherT[IO, Exception, Unit] = for {
4351
List("www.subdomain1.snowplowanalytics.com", "www.subdomain2.snowplowanalytics.com")
4452
), new Exception("No parseable referer"))
4553
_ <- EitherT.right(IO { println(referer2) })
46-
// => InternalReferer
47-
54+
// => InternalReferer(InternalMedium)
4855

4956
// Various overloads are available for common cases, for instance
5057
maybeReferer1 = parser.parse("https://www.bing.com/search?q=snowplow")
@@ -60,25 +67,13 @@ More examples can be seen in [ParseTest.scala][parsetest-scala]. See [Parser.sca
6067
[parsetest-scala]: src/test/scala/com/snowplowanalytics/refererparser/ParseTest.scala
6168
[parser-scala]: src/main/scala/com/snowplowanalytics/refererparser/Parser.scala
6269

63-
### Installation
64-
65-
Add this to your SBT config:
66-
67-
```scala
68-
val refererParser = "com.snowplowanalytics" %% "referer-parser" % "0.5.0"
69-
```
70-
7170
## Contributing
7271

73-
1. Fork it
74-
2. Create your feature branch (`git checkout -b my-new-feature`)
75-
3. Commit your changes (`git commit -am 'Add some feature'`)
76-
4. Push to the branch (`git push origin my-new-feature`)
77-
5. Create new Pull Request
72+
Check out [our contributing guide](CONTRIBUTING.md).
7873

7974
## Copyright and license
8075

81-
The referer-parser Java/Scala library is copyright 2012-2018 Snowplow Analytics Ltd.
76+
The referer-parser Java/Scala library is copyright 2012-2019 Snowplow Analytics Ltd.
8277

8378
Licensed under the [Apache License, Version 2.0][license] (the "License");
8479
you may not use this software except in compliance with the License.

build.sbt

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1+
/**
2+
* Copyright 2012-2019 Snowplow Analytics Ltd
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
val root = (project in file(".")).
217
enablePlugins(ScalaUnidocPlugin, GhpagesPlugin).
318
settings(
4-
name := "scala-referer-parser",
5-
organization := "com.snowplowanalytics",
6-
version := "0.5.0",
7-
description := "Library for extracting marketing attribution data from referer URLs",
8-
scalaVersion := "2.12.8",
19+
name := "scala-referer-parser",
20+
organization := "com.snowplowanalytics",
21+
version := "1.0.0",
22+
description := "Library for extracting marketing attribution data from referer URLs",
23+
scalaVersion := "2.12.8",
924
crossScalaVersions := Seq("2.11.12", "2.12.8"),
10-
scalacOptions := BuildSettings.compilerOptions,
11-
25+
javacOptions := BuildSettings.javaCompilerOptions,
26+
scalafmtOnCompile := true,
1227
libraryDependencies ++= Seq(
1328
Dependencies.Libraries.catsCore,
1429
Dependencies.Libraries.circeCore,

project/BuildSettings.scala

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2018 Snowplow Analytics Ltd
2+
* Copyright 2012-2019 Snowplow Analytics Ltd
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,21 +32,10 @@ import scoverage.ScoverageKeys._
3232

3333
object BuildSettings {
3434

35-
lazy val compilerOptions = Seq(
36-
"-deprecation",
37-
"-encoding", "UTF-8",
38-
"-feature",
39-
"-language:existentials",
40-
"-language:higherKinds",
41-
"-language:implicitConversions",
42-
"-unchecked",
43-
"-Yno-adapted-args",
44-
"-Ywarn-dead-code",
45-
"-Ywarn-numeric-widen",
46-
"-Xfuture",
47-
"-Xlint",
48-
"-Ypartial-unification"
49-
)
35+
lazy val javaCompilerOptions = Seq(
36+
"-source", "1.8",
37+
"-target", "1.8"
38+
)
5039

5140
lazy val publishSettings = bintraySettings ++ Seq(
5241
publishMavenStyle := true,

project/Dependencies.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2018 Snowplow Analytics Ltd
2+
* Copyright 2012-2019 Snowplow Analytics Ltd
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,10 +17,10 @@ import sbt._
1717

1818
object Dependencies {
1919
object V {
20-
val catsCore = "1.5.0"
21-
val catsEffect = "1.1.0"
22-
val circe = "0.11.0"
23-
val specs2 = "4.3.6"
20+
val catsCore = "1.6.0"
21+
val catsEffect = "1.2.0"
22+
val circe = "0.11.1"
23+
val specs2 = "4.4.1"
2424
}
2525

2626
object Libraries {
@@ -29,7 +29,7 @@ object Dependencies {
2929
val circeCore = "io.circe" %% "circe-core" % V.circe
3030
val circeGeneric = "io.circe" %% "circe-generic" % V.circe
3131
val circeParser = "io.circe" %% "circe-parser" % V.circe
32-
val specs2Core = "org.specs2" %% "specs2-core" % V.specs2 % "test"
33-
val specs2Scalacheck = "org.specs2" %% "specs2-scalacheck" % V.specs2 % "test"
32+
val specs2Core = "org.specs2" %% "specs2-core" % V.specs2 % Test
33+
val specs2Scalacheck = "org.specs2" %% "specs2-scalacheck" % V.specs2 % Test
3434
}
3535
}

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.2.1
1+
sbt.version=1.2.8

project/plugins.sbt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1")
2-
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")
3-
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2")
4-
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
5-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
6-
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
1+
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1")
2+
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")
3+
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2")
4+
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
5+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
6+
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
7+
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.5")

src/main/scala/com/snowplowanalytics/refererparser/CorruptJsonException.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2018 Snowplow Analytics Ltd
2+
* Copyright 2012-2019 Snowplow Analytics Ltd
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)