implicit.ly

Scala software, hot off the presses

Dispatch 0.8.7

Breaking Changes

If using the </> verb to parse XML, you must now bring it into scope explicitly:

import dispatch.XhtmlParsing._

There's a good reason for this! (See below.)

JSoup and TagSoup modules

Thanks to a big contribution from daros, Dispatch now integrates with parsers that can handle real-world HTML. The handler verb </> is used across all HTML parsers, resolved by its imported implicit conversions. For usage instructions and examples, see the Dispatch documentation for TagSoup and JSoup.

Support byte arrays for POST

This contribution by dyross (no relation?) adds

def << (contents: Array[Byte])

to the standard set of request verbs.

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.

Filed under  //   Dispatch   Scala 2.8.0   Scala 2.8.1   Scala 2.8.2   Scala 2.9.0   Scala 2.9.0-1   Scala 2.9.1   net.databinder  

Unfiltered 0.5.3

  • Fix for regression introduced in 0.5.2 in the resources handler of unfiltered-netty-server. Unique instances of the ChunkedWriteHandler were not created for each request, causing bad responses.
  • Fix for issue #100 (woot?), Sec-WebSocket-Location (WSLocation) is hard-coded to ws:// protocol { romusz }

Unfiltered is a toolkit for servicing HTTP requests in Scala.

Unfiltered 0.5.2

Intent chaining

Applications that internally chain intent functions are now recommended to use Pass.onPass rather than the orElse method defined on PartialFunction.

Pass.onPass is aware of the explicit Pass object that may be returned by intents and it is also more efficient than orElse for many chained intent functions. There are two ways to use onPass:

import unfiltered.request._
val combined1 = Pass.onPass(intent1, intent2)
val combined2 = intent1.onPass(intent2)

These two produce the same combined intent function; the second uses an implicit conversion imported from the package object.

unfiltered-netty-server

In recent releases plan and handler took a by-name parameter to support the case where new instances of Netty handlers are required for each request. This lead to unexpected behavior for some more common use cases, where the caller passed in a new handler thinking it would be shared for all requests.

To avoid confusion, we've restored the previous parameter types to plan and handler methods. If you need to pass in a plan "factory", such as for a chunk aggregator, there is a new method makePlan that takes a by-name parameter. The new chunked(maxContentLength: Int) convenience method also provides this behavior directly.

unfiltered-netty-websockets

Fixed issue #99, error when decoding large web socket messages.

unfiltered-scalatest

Corrected scala-test dependencies for different versions of Scala. { dwestheide }

unfiltered-jetty

Updated dependency to 7.5.4.v20111024 { max-l }

Fixed issue #89, use of deprecated Jetty keystore methods.

ls.implicit.ly

Added ls plugin to the build and metadata to the repository, so that Unfiltered releases are recorded at ls/unfiltered. Also, FYI! The ls server is built with Unfiltered.

Unfiltered is a toolkit for servicing HTTP requests in Scala.

Dispatch 0.8.6

Features

Fixes

  • Explicit return type for make_client to fix override problem, contributed by ostewart
  • Avoid slow stream reader usage in json parsing, contributed by pomu0325

Dependencies

News

The Dispatch repository has moved: https://github.com/dispatch/dispatch

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.

Filed under  //   Dispatch   Scala 2.8.0   Scala 2.8.1   Scala 2.8.2   Scala 2.9.0   Scala 2.9.0-1   Scala 2.9.1   net.databinder  

grizzled-scala 1.0.9

  • Fixed grizzled.readline so that a newline in the prompt doesn't return None (for EOF).
  • Based on pull request #3, by Dan Sully, added the following features to grizzled.config:
  • Section name regular expression can now be specified to Configuration objects, thus allowing alternate section name forms.
  • Comment regular expression can now be specified to Configuration, allowing alternate comment syntaxes.
  • Configuration now supports at getAsList() method, which returns a value split into a string list. Delimiters may be specified. The value returned is of type Option[List[String]].

The Grizzled Scala Library contains a variety of miscellaneous utility classes and objects. Basically, whenever I find myself writing something that's general-purpose, I put it in here, so I can easily use it in multiple projects.

Filed under  //   Scala 2.8.0   Scala 2.8.1   Scala 2.9.0   Scala 2.9.0-1   Scala 2.9.1   grizzled-scala   org.clapper  

scalariform 0.1.1

  • FIX: Leave PCDATA whitespace untouched inside a single-line XML tag (issue #27)
  • FIX: indent for indentLocalDefs on first line of function block (issue #24)
  • ParenExpr now allows newline after opening paren (issue #18)
  • FIX: spurious indentation in staggered dot expressions (issue #25)
  • Preserve newline before annotations (issue #28)
  • Add option to support CompactControlReadability style (issue #22) (thanks to by Owein Reese (https://github.com/wheaties) and Rose Toomey (https://github.com/rktoomey) for the patch
  • Preserve newline before anonymous function argument (issue #21)
  • Allow one-line anonymous function blocks
  • Fix parser crash on argument-less constructor annotations
  • Add PlaceScaladocAsterisksBeneathSecondAsterisk preference to conform to recommended Scaladoc style (issue #30)
  • FIX: Removal of space causing token merge in varargs and unary ops (http://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1000601)
  • Switch to sbt 0.11 build

Scalariform is a source code formatter for Scala.

Unfiltered 0.5.1

Asynchronous Servlet Responses

Asynchronous responses are now supported for Servlet 3.0 filters, via the unfiltered-filter-async module using Jetty continuations. See the updated bindings documentation for an example. { pk11 }

Websockets

The unfiltered-netty-websockets module is updated to support IETF draft 10 of the specification, supported by Firefox 7 and Chrome 14. { softprops }

Cookies

Cookies are supported with request matchers and response functions, as described in a new documentation section. { softprops }

Github Organization

Our source repository now belongs to the Unfiltered github organization. Bookmarks and git remotes must be updated to unfiltered/unfiltered.

Netty Executors

Netty cycle plans now have their own default thread pools instead of sharing a global pool, to simplify a graceful shutdown. Applications are recommended, as before, to define their own memory-bound thread pools tailored to their production environment. { n8han }

Eclipse-compatible Source Jars

The published source jars now fully nested package-directories as required by Eclipse for navigation to library sources. { tekul }

Unfiltered is a toolkit for servicing HTTP requests in Scala.

scala-arm 1.0

The scala-arm 1.0 release makes a few stabilizing changes to the API:

  • Removed the CanSafelyTranslate implicit hook for map/flatMap methods. ManagedResource objects are now properly Monadic.
  • The toTraversable method now takes implicit evidence that the resource is traversable. This can also take a function from the reosurce to a traversable.
  • The Resource type trait now specifies which exceptions cannot be ignored vs. which ones can safely be captured temporarily to close a resource.
  • Had to remove 2.9.0 and 2.9.0-1 versions temporarily due to strange scaladoc bug that was fixed in 2.9.1

Scala Automatic Resource Management

scala-arm is an automatic resource management library for Scala. The scala-arm library provides equivalent and improved fucntionality to Java 7's ARM.

Basic Usage

The Scala ARM library provides three "modes" of operations:

  • Imperative style resource management functions.
  • A monadic style resource management class.
  • A delimited continuation style API.

Imperative Style

The Scala ARM library allows users to ensure opening closing of resources within blocks of code using the managed method. This is easiest to accomplish with a for expression and the managed method defined on scala.resource:

import resource._
for(input <- managed(new FileInputStream("test.txt")) {
  // Code that uses the input as a FileInputStream
}

Monadic Style

The scala-arm library defined a monadic like container ManagedResource. This container defines map and flatMap interfaces. It can be constructed using the managed method defined on scala.resource. The map and flatMap methods are defined specially, but in generally they will do what you expect them to.
The map method will take a transformation of the raw resource type and return a new managed resource object of the transformed type. Let's see an example:

import resource._
val first_ten_bytes = managed(new FileInputStream("test.txt")) map { 
   input =>
     val buffer = new Array[Byte](10)
     input.read(buffer)
     buffer
}

This constructs a new resource that will obtain the first ten bytes of a file when aquired, each and every time. This allows you to build up behavior inside of a ManagedResource monad before attempting to acquire and execute the behavior. This is an excellent way to construct the means of querying for data and obtaining it fresh when needed.

Delimtied Continuations

The scala-arm library also supports using delimited continuations. This is done via the reflect method on ManagedResource. This can be used to "flatten" the nested blocks required to use resources. The best example is the and method defined on scala.resource. This method can be used to combine two resources into a single ManagedResource class containing a tuple of the two resources. It will jointly open and close both resources. The code is below:

import resource._
def and[A,B](r1 : ManagedResource[A], r2 : ManagedResource[B]) = 
    new ManagedResource[(A,B)] with ManagedResourceOperations[(A,B)] {
      override def acquireFor[C](f : ((A,B)) => C) = withResources {
        f( (r1.reflect[C], r2.reflect[C]) )
      }
    }

avsl 0.3.6

Merged patched from Erik Rozendaal: Use slf4j's MessageFormatter correctly to format log messages with arguments.

AVSL is a very simple logger, written in Scala. AVSL implements the Simple Logging Facade for Java (SLF4J) API, allowing applications to be written to the SLF4J API, for portability. It uses a simple, non-XML configuration file.

Filed under  //   Scala 2.8.0   Scala 2.8.1   Scala 2.9.0   Scala 2.9.0-1   Scala 2.9.1   avsl   org.clapper  

Unfiltered 0.5.0

Library

New unfiltered-agents module for targeting and identifying common user agents provided by chrislewis

Upload

unfiltered-uploads StreamedFileWrapper#stream method now returns a generic type T #47

Scalate

Display of template compilation errors in development mode and fix for additional attribute overrides was contributed by teamon.

Netty

Unfiltered's Netty support undergoes a number of changes with this release. Most noticeably, applications are now required to define exception handling behavior for both async.Plan and cycle.Plan, and request execution behavior for the cycle.Plan. Details are available in the expanded Unfiltered documentation.

netty-server now depends on the netty module. This will provide more design consistency when implementing server behavior. If you were depending on unfiltered-netty before, you likely need to depend on unfiltered-netty-server now.

There is a new resources method in the netty-server module's Http and Https objects. By default, this handler will pass netty MessageEvents upstream if a file can not be resolved. To return NotFound or Forbidden responses for stand-alone static resource servers, use Http(...).resources(url, passOnFail = false)

netty-server Http and Https objects now define local and anylocal methods for binding to loopback interfaces

Headers parsed as Dates should now be parsed using a US Locale to avoid potentional conflict when parsing dates

Unfiltered is a toolkit for servicing HTTP requests in Scala.

Filed under  //   Scala 2.8.0   Scala 2.8.1   Scala 2.9.0   Scala 2.9.0-1   Scala 2.9.1   Unfiltered   net.databinder