forked from VerbalExpressions/ScalaVerbalExpressions
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request VerbalExpressions#2 from pathikrit/master
Major rewrite
- Loading branch information
Showing
11 changed files
with
338 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,71 @@ | ||
# Git Ignore compiled from https://github.com/github/gitignore | ||
|
||
# OSX # | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
.Spotlight-V100 | ||
.Trashes | ||
*~ | ||
|
||
# Windows # | ||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
$RECYCLE.BIN/ | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
# IntelliJ # | ||
*.iml | ||
*.ipr | ||
*.iws | ||
out/ | ||
.idea/ | ||
.idea_modules/ | ||
atlassian-ide-plugin.xml | ||
|
||
# Eclipse # | ||
*.pydevproject | ||
.metadata | ||
.gradle | ||
bin/ | ||
tmp/ | ||
*.tmp | ||
*.bak | ||
*.swp | ||
*~.nib | ||
local.properties | ||
.settings/ | ||
.loadpath | ||
.externalToolBuilders/ | ||
*.launch | ||
.cproject | ||
.buildpath | ||
.target | ||
.texlipse | ||
|
||
# Java # | ||
*.class | ||
*.log | ||
.mtj.tmp/ | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
# sbt specific | ||
dist/* | ||
# sbt # | ||
cache/ | ||
.history/ | ||
.lib/ | ||
dist/ | ||
target/ | ||
lib_managed/ | ||
src_managed/ | ||
project/boot/ | ||
project/plugins/project/ | ||
|
||
# Scala-IDE specific | ||
# Scala # | ||
.scala_dependencies | ||
.worksheet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
language: scala | ||
|
||
scala: 2.11.1 | ||
|
||
env: | ||
- SBT_OPTS="-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:PermSize=256M -XX:MaxPermSize=512M" | ||
|
||
after_success: | ||
- export COVERALLS_REPO_TOKEN=KaV31nMn63pJSb6hSLsbT97lfgBtB8VEL | ||
- sbt coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,38 @@ | ||
[![Build Status](https://travis-ci.org/pathikrit/ScalaVerbalExpressions.png?branch=master)](http://travis-ci.org/pathikrit/ScalaVerbalExpressions) [![Coverage Status](https://coveralls.io/repos/pathikrit/ScalaVerbalExpressions/badge.png)](https://coveralls.io/r/pathikrit/ScalaVerbalExpressions) | ||
|
||
ScalaVerbalExpressions | ||
===================== | ||
## Other implementations | ||
You can view all implementations on [VerbalExpressions.github.io](http://VerbalExpressions.github.io) | ||
|
||
```scala | ||
import com.github.verbalexpressions.VerbalExpression | ||
import VerbalExpression._ | ||
|
||
val validUrl = $.startOfLine() | ||
.andThen("http") | ||
.maybe("s") | ||
.andThen("://") | ||
.maybe("www.") | ||
.anythingBut(" ") | ||
.endOfLine() | ||
|
||
assert("https://www.google.com" is validUrl) | ||
assert("ftp://home.comcast.net" isNot validUrl) | ||
|
||
// VerbalExpressions can be nested within each other | ||
val fraction = $.andThen(".").digits() | ||
val number = $.maybe("-").digits().maybe(fraction) | ||
|
||
assert(Seq("3", "-4", "-0.458") forall number.check) | ||
assert(Seq("0.", "hello", "4.3.2") forall number.notMatch) | ||
``` | ||
|
||
For more methods, checkout the [wiki](https://github.com/VerbalExpressions/JSVerbalExpressions/wiki) and the [source](src/main/scala/com/github/verbalexpressions/VerbalExpression.scala) | ||
|
||
sbt | ||
=== | ||
Add the following to your `build.sbt`: | ||
```scala | ||
resolvers += "Sonatype releases" at "http://oss.sonatype.org/content/repositories/releases/" | ||
|
||
libraryDependency += "com.github.verbalexpressions" %% "ScalaVerbalExpressions" % "1.0.0" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,47 @@ | ||
import SonatypeKeys._ | ||
|
||
name := "ScalaVerbalExpression" | ||
|
||
version := "0.0.1" | ||
version := "1.0.0" | ||
|
||
scalaVersion := "2.10.2" | ||
description := "VerbalExpressions in Scala" | ||
|
||
licenses += ("MIT", url("http://opensource.org/licenses/MIT")) | ||
|
||
organization := "com.github.verbalexpressions" | ||
|
||
scalaVersion := "2.11.1" | ||
|
||
crossScalaVersions := Seq("2.10.4", "2.11.1") | ||
|
||
scalacOptions ++= Seq( | ||
"-unchecked", "-deprecation", "-feature", | ||
"-language:postfixOps,implicitConversions,experimental.macros,dynamics,existentials,higherKinds" | ||
) | ||
|
||
libraryDependencies ++= Seq( | ||
"org.specs2" %% "specs2" % "2.1.1" % "test" | ||
"org.specs2" %% "specs2" % "2.3.12" % "test" | ||
) | ||
|
||
scalacOptions in Test ++= Seq("-Yrangepos") | ||
sonatypeSettings | ||
|
||
instrumentSettings | ||
|
||
CoverallsPlugin.coverallsSettings | ||
|
||
autoCompilerPlugins := true | ||
|
||
resolvers ++= Seq("snapshots" at "http://oss.sonatype.org/content/repositories/snapshots", | ||
"releases" at "http://oss.sonatype.org/content/repositories/releases") | ||
pomExtra := { | ||
<url>http://github.com/pathikrit/ScalaVerbalExpressions</url> | ||
<scm> | ||
<url>git@github.com:pathikrit/ScalaVerbalExpressions.git</url> | ||
<connection>scm:git:git@github.com:pathikrit/ScalaVerbalExpressions.git</connection> | ||
</scm> | ||
<developers> | ||
<developer> | ||
<id>pathikrit</id> | ||
<name>Pathikrit Bhowmick</name> | ||
<url>http://github.com/pathikrit</url> | ||
</developer> | ||
</developers> | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=0.13.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
resolvers ++= Seq( | ||
Classpaths.sbtPluginReleases | ||
) | ||
|
||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.2.1") | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3") | ||
|
||
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "0.99.5") | ||
|
||
addSbtPlugin("com.sksamuel.scoverage" %% "sbt-coveralls" % "0.0.5") | ||
|
||
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.6") |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.