Skip to content
/ klob Public

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

Notifications You must be signed in to change notification settings

shyiko/klob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

klob Build Status Maven Central ktlint

A .gitgnore-pattern-based glob library for Kotlin and/or Java 8+.
Used by/Extracted from ktlint.

Usage

<dependency>
  <groupId>com.github.shyiko.klob</groupId>
  <artifactId>klob</artifactId>
  <version>0.2.0</version>
  <!-- omit classifier below if you plan to use this library in koltin -->
  <classifier>kalvanized</classifier>
</dependency>

(java)

# find all files matching the patterns (! = exclude) 
Path path = Glob.from("src/**/*.kt", "!src/generated")
    .iterate(Paths.get("."))
    /*: Iterator<Path> */
    .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<Path> */
    .next()

Development

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 license.
Copyright (c) 2017 Stanley Shyiko.

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published