Skip to content

Commit

Permalink
Issue #177 rename package from com.novus.salat._ to just salat._ in p…
Browse files Browse the repository at this point in the history
…reparation for 1.10.0 release.

Also:
- Read me update
- unit test broken by rename (fixed)
- updated about.markdown. Probably should just delete this as it is a sub-set of the readme.
- For some reason MissingGraterExplanationSpec was deleted / added instead of moved. Probably b/c the entire test is commented out (wat?). If you are reading this commit trying to figure out what happened there - I'm sorry: it was IntelliJ.
  • Loading branch information
noahlz committed Sep 12, 2016
1 parent f4ff8fb commit 5b3b02a
Show file tree
Hide file tree
Showing 135 changed files with 741 additions and 701 deletions.
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -44,13 +44,11 @@ Starting with version 1.10.0, the package for Salat has changed.

**Version 1.10.x and Later**

TODO

`import salat._`

**Version 1.9.x and Earlier**

`import com.novus.salat._`
`import salat._`

### Repositories

Expand Down
12 changes: 7 additions & 5 deletions notes/1.10.0.markdown
@@ -1,11 +1,13 @@
# DRAFT
1.10.0 is a major release of Salat with breaking changes. It includes support for Casbah 2.8.2 / Mongo 3.0, various bug fixes, and better error messages for common serialization issues.

1.10.0 is a major release of Salat with breaking changes.

Notably, the package has changed from `com.novus.salat._` to `salat._`
Most notably, the package has changed from `com.novus.salat._` to `salat._`

# Change Log

## Major Changes

- \#177 Change package from `com.nouvs.salat._` to just `salat._`

## Dependency Upgrades

- \#145 Upgrade to Casbah 2.8.2 (@danslapman, @sief, @noahlz)
Expand All @@ -27,4 +29,4 @@ Notably, the package has changed from `com.novus.salat._` to `salat._`

- Introduced a new subclass of `Error`, `SalatGlitch`, that specifically identifies errors that occur during serialization / deserialization. Note that there are still many points in code that throw RuntimeException (via sys.error) - overhaul/normalization of Salat's errors remains an outstanding TODO.

- Previously case classes with fields of type `Int`, `Option[Int]`, `Seq[Int]`, or `Map[Int]` would experience narrowing with information loss, or a classcast exception when attempting to unbox the field value, if the deserialized a JSON or Mongo document contained a Double value in the field. In addition, a JSON document with goofy contents like `{"foo":"nine-point-oh"}` would return a `None`, swallowing the `NumberFormatException`, if `"foo"` was an `Option[Double]` or somesuch. With this version, deserialization will fail more agressively if the JSON document has a field with a String in an invalid number format, or a Double literal that cannot be narrowed without loss of information (9.0001). Doubles that can be narrowed without loss will be converted to an Int, however (`9.0` converted to `9`, for example).
- Previously case classes with fields of type `Int`, `Option[Int]`, `Seq[Int]`, or `Map[Int]` would experience narrowing with information loss, or a classcast exception when attempting to unbox the field value, if the deserialized a JSON or Mongo document contained a Double value in the field. In addition, a JSON document with goofy contents like `{"foo":"nine-point-oh"}` would return a `None`, swallowing the `NumberFormatException`, if `"foo"` was an `Option[Double]` or somesuch. With this version, deserialization will fail more agressively if the JSON document has a field with a String in an invalid number format, or a Double literal that cannot be narrowed without loss of information (9.0001). However, in an attempt to account for the fact that JavaScript only has a float numeric type, Doubles that can be narrowed without loss will be converted to an Int (`9.0` converted to `9`, for example).
16 changes: 8 additions & 8 deletions notes/about.markdown
Expand Up @@ -8,20 +8,20 @@ Salat currently supports bidirectional serialization for:

Find us online:

- Project: [http://novus.github.com/salat][project]
- Source code: [https://github.com/novus/salat][source]
- Wiki: [https://github.com/novus/salat/wiki][wiki]
- CI: [http://travis-ci.org/#!/novus/salat][ci]
- Project: [http://salat.github.io/salat][project]
- Source code: [https://github.com/salat/salat][source]
- Wiki: [https://github.com/salat/salat/wiki][wiki]
- CI: [http://travis-ci.org/#!/salat/salat][ci]
- Mailing List: [http://groups.google.com/group/scala-salat][group]
- StackOverflow: [http://stackoverflow.com/questions/tagged/salat][so]

Salat is an Open Source project under the Apache License v2.

[casbah]: https://github.com/mongodb/casbah/
[JSON4S]: http://json4s.org/
[project]: http://novus.github.com/salat
[source]: https://github.com/novus/salat
[wiki]: https://github.com/novus/salat/wiki
[ci]: http://travis-ci.org/#!/novus/salat
[project]: http://salat.github.io/salat
[source]: https://github.com/salat/salat
[wiki]: https://github.com/salat/salat/wiki
[ci]: http://travis-ci.org/#!/salat/salat
[group]: http://groups.google.com/group/scala-salat
[so]: http://stackoverflow.com/questions/tagged/salat
Expand Up @@ -25,17 +25,17 @@
* StackOverflow: http://stackoverflow.com/questions/tagged/salat
*
*/
package com.novus.salat
package salat

import java.lang.reflect.Modifier
import java.util.concurrent.ConcurrentHashMap

import com.mongodb.casbah.Imports._
import com.novus.salat.annotations.util._
import com.novus.salat.json.JSONConfig
import com.novus.salat.transformers.CustomTransformer
import com.novus.salat.util._
import com.novus.salat.{Field => SField}
import salat.annotations.util._
import salat.json.JSONConfig
import salat.transformers.CustomTransformer
import salat.util._
import salat.{Field => SField}
import org.json4s.JsonAST.JObject

trait Context extends ContextLifecycle with Logging {
Expand Down Expand Up @@ -171,7 +171,7 @@ trait Context extends ContextLifecycle with Logging {
}

protected[salat] def needsProxyGrater(clazz: Class[_]) = {
val usedSalatAnnotation = clazz.annotated_?[com.novus.salat.annotations.raw.Salat]
val usedSalatAnnotation = clazz.annotated_?[salat.annotations.raw.Salat]
val isTrait = clazz.isInterface
val isAbstractClazz = Modifier.isAbstract(clazz.getModifiers)
val outcome = usedSalatAnnotation || isTrait || isAbstractClazz
Expand Down
Expand Up @@ -26,13 +26,13 @@
*
*/

package com.novus.salat
package salat

import com.mongodb.DBObject
import com.mongodb.casbah.commons.Implicits._
import com.mongodb.casbah.commons.MongoDBObject
import com.novus.salat.json.ToJField
import com.novus.salat.transformers.CustomTransformer
import salat.json.ToJField
import salat.transformers.CustomTransformer
import org.json4s.JsonAST.JObject
import org.json4s._

Expand Down
Expand Up @@ -25,14 +25,14 @@
* StackOverflow: http://stackoverflow.com/questions/tagged/salat
*
*/
package com.novus.salat
package salat

import java.lang.reflect.Method

import com.novus.salat.annotations.raw._
import com.novus.salat.annotations.util._
import com.novus.salat.transformers._
import com.novus.salat.util.Logging
import salat.annotations.raw._
import salat.annotations.util._
import salat.transformers._
import salat.util.Logging

import scala.tools.scalap.scalax.rules.scalasig._

Expand Down
Expand Up @@ -25,16 +25,16 @@
* StackOverflow: http://stackoverflow.com/questions/tagged/salat
*
*/
package com.novus.salat
package salat

import java.lang.reflect.{InvocationTargetException, Method}

import com.mongodb.casbah.Imports._
import com.novus.salat.annotations.raw._
import com.novus.salat.annotations.util._
import com.novus.salat.json.{FromJValue, ToJField}
import com.novus.salat.util.{Logging, _}
import com.novus.salat.{Field => SField}
import salat.annotations.raw._
import salat.annotations.util._
import salat.json.{FromJValue, ToJField}
import salat.util.{Logging, _}
import salat.{Field => SField}
import org.json4s._
import org.json4s.native.JsonMethods._
import org.json4s.native.JsonParser
Expand Down Expand Up @@ -106,7 +106,7 @@ abstract class Grater[X <: AnyRef](val clazz: Class[X])(implicit val ctx: Contex

def fromBSON(bytes: Array[Byte]): X = {
val decoded = org.bson.BSON.decode(bytes)
val mdbo = com.novus.salat.bson.BSONObjectToMongoDbObject(decoded)
val mdbo = salat.bson.BSONObjectToMongoDbObject(decoded)
asObject(mdbo)
}

Expand Down
Expand Up @@ -26,11 +26,11 @@
*
*/

package com.novus.salat
package salat

import java.math.{BigInteger, MathContext}

import com.novus.salat.util.Logging
import salat.util.Logging

sealed trait BigDecimalStrategy extends Logging {

Expand All @@ -54,6 +54,7 @@ sealed trait BigDecimalStrategy extends Logging {

/**
* To provide backward compatibility with different serialization output, be as forgiving as possible when deserializing
*
* @param x anything that could reasonably be coerced into BigDecimal-hood
* @return BigDecimal
*/
Expand Down
Expand Up @@ -26,7 +26,7 @@
*
*/

package com.novus.salat
package salat

import com.mongodb.casbah.Imports._
import org.json4s.JsonAST.JObject
Expand Down
Expand Up @@ -25,13 +25,13 @@
* StackOverflow: http://stackoverflow.com/questions/tagged/salat
*
*/
package com.novus.salat
package salat

import java.util.concurrent.ConcurrentHashMap
import java.util.regex.Pattern

import com.novus.salat.util.encoding.TypeHintEncoding
import com.novus.salat.util.{ClassPrettyPrinter, Logging}
import salat.util.encoding.TypeHintEncoding
import salat.util.{ClassPrettyPrinter, Logging}

// TODO: oof. this is not OO design at its most graceful. refactor it!

Expand Down
Expand Up @@ -26,7 +26,7 @@
*
*/

package com.novus.salat.bson
package salat.bson

import com.mongodb.casbah.Imports._
import org.bson._
Expand Down
Expand Up @@ -26,7 +26,7 @@
*
*/

package com.novus.salat.conversions
package salat.conversions

import com.mongodb.casbah.commons.conversions.MongoConversionHelper
import com.mongodb.casbah.commons.conversions.scala.JodaDateTimeHelpers
Expand Down

0 comments on commit 5b3b02a

Please sign in to comment.