https://github.com/softprops/opener
everyone loves a good opener
https://github.com/softprops/opener
Last synced: about 1 month ago
JSON representation
everyone loves a good opener
- Host: GitHub
- URL: https://github.com/softprops/opener
- Owner: softprops
- License: mit
- Created: 2013-08-10T15:32:02.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2014-08-11T00:38:26.000Z (almost 12 years ago)
- Last Synced: 2025-01-11T05:46:39.813Z (over 1 year ago)
- Language: Scala
- Homepage:
- Size: 148 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# opener
> open with something good
Opener provides interfaces for opening files and URI's on your desktop using this [tool](http://docs.oracle.com/javase/6/docs/api/java/awt/Desktop.html) which may or may not be available depending on your environment. When it's not, that's okay too.
## install
Via the copy and paste method
```scala
resolvers += "softprops-maven" at "http://dl.bintray.com/content/softprops/maven"
libraryDependencies += "me.lessis" %% "opener" % "0.1.0"
```
Via [a more civilized method](https://github.com/softprops/ls#readme) which will do the same without all the manual work.
> ls-install opener
Note. If you are a [bintray-sbt](https://github.com/softprops/bintray-sbt#readme) user you can optionally specify the resolver as
```scala
resolvers += bintray.Opts.resolver.repo("softprops", "maven")
```
## usage
Each operation is exposed as an object with an apply for the type of input the operation expects. You can open with `opener.Browse`, `opener.Edit`, `opener.Mail`, and `opener.Open`. Each operation returns a `scala.util.Try` of the attempted operation. A few examples are given below.
Open this projects readme on github.com
```scala
opener.Browse(new java.net.URI("https://github.com/softprops/opener#readme"))
```
Tell your mom how much you miss her using a service that she'll understand ( email )
```scala
opener.Mail(new java.net.URI("mailto:mom@gmail.com?subject=hi%20mom&body=miss%20you"))
```
Doug Tangren (softprops) 2013