Skip to content

Commit

Permalink
Merge branch 'release/v1.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonkmi committed Nov 24, 2019
2 parents 4823d36 + b10a4eb commit 23d9d34
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: scala
scala:
- 2.12.6
jdk:
- oraclejdk8
dist: trusty

# safelist
branches:
only:
- master
- develop
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [v1.0.8]

### Changed
- Fixed incorrect exception class name.

## [v1.0.7]

### Added
Expand Down Expand Up @@ -44,4 +49,5 @@ All notable changes to this project will be documented in this file.
[v1.0.4]: https://github.com/andersonkmi/spark-utils/compare/v1.0.3...v1.0.4
[v1.0.5]: https://github.com/andersonkmi/spark-utils/compare/v1.0.4...v1.0.5
[v1.0.6]: https://github.com/andersonkmi/spark-utils/compare/v1.0.5...v1.0.6
[v1.0.7]: https://github.com/andersonkmi/spark-utils/compare/v1.0.6...v1.0.7
[v1.0.7]: https://github.com/andersonkmi/spark-utils/compare/v1.0.6...v1.0.7
[v1.0.8]: https://github.com/andersonkmi/spark-utils/compare/v1.0.7...v1.0.8
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Spark Utils
# Spark Utils [![Build Status](https://travis-ci.org/andersonkmi/spark-utils.svg?branch=master)](https://travis-ci.org/andersonkmi/spark-utils)
Library with common objects used in other Spark/Scala projects

## 1. Introduction
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ organization := "org.codecraftlabs.spark"

name := "spark-utils"

val appVersion = "1.0.7"
val appVersion = "1.0.8"

val appName = "spark-utils"

Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/org/codecraftlabs/spark/utils/ArgsUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import scala.collection.mutable
object ArgsUtils {
private val ArgsKeyIndicator: String = "--"

@throws(classOf[Exceptions])
@throws(classOf[InvalidArgsException])
def parseArgs(args: Array[String]): Map[String, String] = {
val result = mutable.Map[String, String]()

Expand All @@ -27,8 +27,8 @@ object ArgsUtils {
}
}

@throws(classOf[Exceptions])
@throws(classOf[InvalidArgsException])
private def validateParsedArgs(args: Map[String, String]): Unit = {
if(args.exists(_._2.isEmpty)) throw Exceptions("Missing arguments")
if(args.exists(_._2.isEmpty)) throw InvalidArgsException("Missing arguments")
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package org.codecraftlabs.spark.utils

final case class Exceptions(private val message: String = "", private val cause: Throwable = None.orNull) extends Exception(message, cause)
final case class InvalidArgsException(private val message: String = "", private val cause: Throwable = None.orNull) extends Exception(message, cause)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ArgsUtilSpec extends FlatSpec with Matchers with BeforeAndAfterAll {

"Single args" should "return 1 empty arg" in {
val args = Array("--test")
an [Exceptions] should be thrownBy ArgsUtils.parseArgs(args)
an [InvalidArgsException] should be thrownBy ArgsUtils.parseArgs(args)
}

"Single arguments" should "return 1 valid arg" in {
Expand Down

0 comments on commit 23d9d34

Please sign in to comment.