oslo


License

License

Categories

Categories

Net
GroupId

GroupId

net.fosdal
ArtifactId

ArtifactId

oslo_2.11
Last Version

Last Version

0.5.5
Release Date

Release Date

Type

Type

jar
Description

Description

oslo
oslo
Project Organization

Project Organization

net.fosdal
Source Code Management

Source Code Management

https://github.com/sfosdal/oslo

Download oslo_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/net.fosdal/oslo_2.11/ -->
<dependency>
    <groupId>net.fosdal</groupId>
    <artifactId>oslo_2.11</artifactId>
    <version>0.5.5</version>
</dependency>
// https://jarcasting.com/artifacts/net.fosdal/oslo_2.11/
implementation 'net.fosdal:oslo_2.11:0.5.5'
// https://jarcasting.com/artifacts/net.fosdal/oslo_2.11/
implementation ("net.fosdal:oslo_2.11:0.5.5")
'net.fosdal:oslo_2.11:jar:0.5.5'
<dependency org="net.fosdal" name="oslo_2.11" rev="0.5.5">
  <artifact name="oslo_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.fosdal', module='oslo_2.11', version='0.5.5')
)
libraryDependencies += "net.fosdal" % "oslo_2.11" % "0.5.5"
[net.fosdal/oslo_2.11 "0.5.5"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
com.typesafe.scala-logging : scala-logging_2.11 jar 3.8.0
joda-time : joda-time jar 2.9.9

test (3)

Group / Artifact Type Version
org.scalacheck : scalacheck_2.11 jar 1.13.5
org.scalamock : scalamock_2.11 jar 4.1.0
org.scalatest : scalatest_2.11 jar 3.0.5

Project Modules

There are no modules declared in this project.

Oslo

Maven Central Build Status Coverage Status Codacy Badge

Overview

Oslo is a tiny Scala library of small but hopefully useful things.

Getting Started

Using SBT, add the following to your build.sbt file (see maven badge for latest version)

libraryDependencies += "net.fosdal" %% "oslo" % "<version>"

User Guide

Most of Oslo is organized around package objects. In general, this means you need to import the package object and the methods are then available for use. Here is a list of the package objects and examples on using them:

net.fosdal.oslo._

TBD

net.fosdal.oslo.ocsv._

TBD

net.fosdal.oslo.odatetime._

TBD

net.fosdal.oslo.oduration._

TBD

net.fosdal.oslo.ofile._

TBD

  def resourceContents(resourcePath: String): String = {
  def fileContents(filePath: String): String = Source.fromFile(filePath).mkString
  def contents(source: String): String = Try(resourceContents(source)).getOrElse(fileContents(source))

net.fosdal.oslo.onumber._

TBD

net.fosdal.oslo.oordering._

TBD

net.fosdal.oslo.oseq._

TBD

net.fosdal.oslo.ostring._

oduration

pretty: converts Duration into pretty string.

import net.fosdal.oslo.oduration._
import scala.concurrent.duration._

4000.seconds.pretty
380.minutes.pretty
35352352.seconds.pretty
res0: String = 1.1h
res1: String = 6.3h
res2: String = 409.2d

pretty(precision:Int): converts Duration into pretty string with supplied precision

import net.fosdal.oslo.oduration._
import scala.concurrent.duration._

4000.seconds.pretty()
380.minutes.pretty(0)
35352352.seconds.pretty(3)
res0: String = 1.1h
res1: String = 6h
res2: String = 409.171d

Versions

Version
0.5.5
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.2.1
0.2
0.1