8000 publish to gh-pages on merge by pepegar · Pull Request #5 · pepegar/hammock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

publish to gh-pages on merge #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
language: scala
scala:
- 2.11.8
- 2.11.8

jdk:
- oraclejdk8

before_install:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then bash
scripts/decrypt-keys.sh; fi
- export PATH=${PATH}:./vendor/bundle

install:
- rvm use 2.2.3 --install --fuzzy
- gem update --system
- gem install sass
- gem install jekyll -v 3.2.1

script:
- sbt test
- sbt ++$TRAVIS_SCALA_VERSION clean coverage coreJVM/test hammockCirceJVM/test coverageReport
- sbt ++$TRAVIS_SCALA_VERSION "docs/tut"

after_success:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then bash
scripts/publishMicrosite.sh; fi
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then echo "Not in master branch, skipping
deploy and release"; fi
- bash <(curl -s https://codecov.io/bash)
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Hammock

[![Build Status](https://travis-ci.org/pepegar/hammock.svg?branch=master)](https://travis-ci.org/pepegar/hammock)
[ ![Download](https://api.bintray.com/packages/pepegar/com.pepegar/hammock-core/images/download.svg) ](https://bintray.com/pepegar/com.pepegar/hammock-core/_latestVersion)
[![codecov](https://codecov.io/gh/pepegar/hammock/branch/master/graph/badge.svg)](https://codecov.io/gh/pepegar/hammock)
[![Download](https://api.bintray.com/packages/pepegar/com.pepegar/hammock-core/images/download.svg)](https://bintray.com/pepegar/com.pepegar/hammock-core/_latestVersion)

Hammock is yet another HTTP client for Scala. Under the hood it's a purely functional wrapper over [Apache Http Commons][httpcommons] for JVM and [XmlHTTPRequest][xhr] for JS.

Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/tut/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ object App {
import IO._
import Log._
import cats._
import hammock.implicits._
import hammock.free._
import hammock.free.algebra._
import hammock.jvm.free._

type Eff1[A] = Coproduct[LogF, IOF, A]
type Eff[A] = Coproduct[HttpRequestF, Eff1, A]
Expand All @@ -138,7 +138,7 @@ object App {
} yield response

def interp1[F[_]](implicit ME: MonadError[F, Throwable]): Eff1 ~> F = Log.interp(ME) or IO.interp(ME)
def interp[F[_]](implicit ME: MonadError[F, Throwable]): Eff ~> F = Interp.trans(client, ME) or interp1(ME) // interpret Hammock's effects
def interp[F[_]](implicit ME: MonadError[F, Throwable]): Eff ~> F = Interpreter.trans(ME) or interp1(ME) // interpret Hammock's effects
}
```

Expand Down
12 changes: 8 additions & 4 deletions docs/src/main/tut/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Just add the following to your `libraryDependencies` in SBT:
```
resolvers += Resolver.bintrayRepo("pepegar", "com.pepegar")

libraryDependencies += "com.pepegar" %% "hammock" % "0.1"
libraryDependencies += "com.pepegar" %% "hammock" % "0.1" // for JVM
libraryDependencies += "com.pepegar" %%% "hammock" % "0.1" // for JS
```

## Modules
Expand All @@ -21,7 +22,8 @@ There are already some companion modules implemented to ease the
experience of using hammock.

```
"com.pepegar" %% "hammock-circe" % "0.1"
libraryDependencies += "com.pepegar" %% "hammock-circe" % "0.1" // for JVM
libraryDependencies += "com.pepegar" %%% "hammock-circe" % "0.1" // for JS
```

## Functional programming
Expand All @@ -34,7 +36,7 @@ you know how to use them!


## HTTP
w

With Hammock you can do HTTP operations in a typeful and functional way.

```tut:silent
Expand All @@ -44,11 +46,13 @@ import scala.util.{ Failure, Success, Try }
import io.circe._
import io.circe.generic.auto._
import hammock._
import hammock.implicits._
import hammock.jvm.free._
import hammock.circe.implicits._


object HttpClient {
implicit val interp = Interpreter

val response = Hammock
.request(Method.GET, "https://api.fidesmo.com/apps", Map()) // In the `request` method, you describe your HTTP request
.run[Try]
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")
addSbtPlugin("com.fortysevendeg" % "sbt-microsites" % "0.4.0")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
6 changes: 6 additions & 0 deletions scripts/decrypt-keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

openssl aes-256-cbc -K $encrypted_4177d4fd1dcb_key -iv $encrypted_4177d4fd1dcb_iv -in travis-deploy-key.enc -out travis-deploy-key -dñ
chmod 600 travis-deploy-key;
cp travis-deploy-key ~/.ssh/id_rsa;

8 changes: 8 additions & 0 deletions scripts/publishMicrosite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

git config --global user.email "jl.garhdez@gmail.com"
git config --global user.name "pepegar"
git config --global push.default simple

sbt docs/publishMicrosite
Binary file added travis-deploy-key.enc
Binary file not shown.
0