An open API service indexing awesome lists of open source software.

https://github.com/shyiko/klob

A .gitgnore-pattern-based glob library for Kotlin and/or Java 8+
https://github.com/shyiko/klob

Last synced: about 1 month ago
JSON representation

A .gitgnore-pattern-based glob library for Kotlin and/or Java 8+

Awesome Lists containing this project

README

        

# klob [![Build Status](https://travis-ci.org/shyiko/klob.svg?branch=master)](https://travis-ci.org/shyiko/klob) [![Maven Central](https://img.shields.io/maven-central/v/com.github.shyiko.klob/klob.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.shyiko.klob%22%20AND%20a%3A%22klob%22) ktlint

A [.gitgnore](https://git-scm.com/docs/gitignore#_pattern_format)-pattern-based glob library for Kotlin and/or Java 8+.
Used by/Extracted from [ktlint](https://github.com/shyiko/ktlint).

## Usage

```xml

com.github.shyiko.klob
klob
0.2.0

kalvanized

```

> (java)

```java
# find all files matching the patterns (! = exclude)
Path path = Glob.from("src/**/*.kt", "!src/generated")
.iterate(Paths.get("."))
/*: Iterator */
.next()

# match directories only
String home = System.getProperty("user.home")
Path path = Glob.from(".IntelliJIdea*/config")
.iterate(Paths.get(home), Glob.IterationOption.SKIP_CHILDREN, Glob.IterationOption.DIRECTORY)
/*: Iterator */
.next()
```

## Development

```sh
git clone https://github.com/shyiko/klob && cd klob
./mvnw # shows how to build, test, etc. project
```

## Legal

All code, unless specified otherwise, is licensed under the [MIT](https://opensource.org/licenses/MIT) license.
Copyright (c) 2017 Stanley Shyiko.