Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
iss #22: update stubs config, fix type param, add dev run scripts & c…
Browse files Browse the repository at this point in the history
…onfig
  • Loading branch information
maizy committed Aug 13, 2014
1 parent a9e5a98 commit 69dc012
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 19 deletions.
28 changes: 10 additions & 18 deletions api_stubs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"query": {
"required": {
"page": "1",
"per_page": "100"
"per_page": "100",
"type": ["open", "private"]
}
},

Expand All @@ -27,7 +28,8 @@
"query": {
"required": {
"page": "1",
"per_page": "100"
"per_page": "100",
"type": ["open", "private"]
}
},

Expand All @@ -40,20 +42,8 @@
"query": {
"required": {
"page": "2",
"per_page": "100"
}
},

"response_file": "orgs/hhru/repos/page2.json",
"headers_file": "orgs/hhru/repos/page2.headers"
},

{
"path": "/orgs/hhru/repos",
"query": {
"required": {
"page": "2",
"per_page": "100"
"per_page": "100",
"type": ["open", "private"]
}
},

Expand All @@ -66,7 +56,8 @@
"query": {
"required": {
"page": "2",
"per_page": "100"
"per_page": "100",
"type": ["open", "private"]
}
},

Expand All @@ -80,7 +71,8 @@
"query": {
"required": {
"page": "1",
"per_page": "100"
"per_page": "100",
"type": "open"
}
},

Expand Down
2 changes: 1 addition & 1 deletion app/hedgehog/clients/github/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Client(val config: Config, implicit val context: scala.concurrent.Executio
"type" -> "open"
)
match {
case h if accountSettings.includePrivateRepos => h.withQueryString("type" ->"private", "type" -> "open")
case h if accountSettings.includePrivateRepos => h.withQueryString("type" ->"private")
case h => h
}
) match {
Expand Down
3 changes: 3 additions & 0 deletions conf/application.conf.ex
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ logger: {

# Logger provided to your application:
application: DEBUG

# HTTP Requests & responses log
#com.ning.http.client: DEBUG
}
62 changes: 62 additions & 0 deletions conf/dev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This is the main configuration file for the application.
# Syntax - HOCON: https://github.com/typesafehub/config#examples-of-hocon
# ~~~~~

# Sources
# -------

github {
api_url = "http://localhost:8000"

# App token for github api access
#
# Generate it on: [https://github.com/settings/applications]
# Scope `public_repo` is required.
# For fetching private organization repositories also add `repo` scope.
app_token = "aaaabbbbccccddddeeeeffff0000111122223333"

# key - user/org name, value - options
sources: [
# users
maizy
{
name = hhru
org = true
include_private_repos = true
}
]
}


# Application settings
# --------------------
application: {

# Secret key
# ----------
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
secret = "p:8d6@s;Dndb[aQ^yjvRGmv308R4KWk3_LRST2sMx7gxDJTNPXIaVjHVEnAjg^KS"

# The application languages
langs = "ru,en"
lang.cookie = "lang"
}


# Logger
# ------
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
logger: {
# Root logger:
root: ERROR

# Logger used by the framework:
play: INFO

# Logger provided to your application:
application: DEBUG

# HTTP Requests & responses log
com.ning.http.client: DEBUG
}
29 changes: 29 additions & 0 deletions dev_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
PORT=9010
BIN=`which play`
SCRIPT_PATH=$(cd ${0%/*} && echo $PWD/${0##*/})
ROOT=`dirname "${SCRIPT_PATH}"`

TYPE="${1}"
CONFIG="${2}"
cd "${ROOT}"

echo -ne "\033]2;hedgehog play app\007"
echo -e "Run app in ${ROOT}, port ${PORT}, play=${BIN}\n"
if [ -z "${CONFIG}" ]; then
if [ "${TYPE}" == "real" ]; then
echo "With real data (application.conf)"
"${BIN}" \
"~run ${PORT}"
else
echo "With stubbed data (dev.conf)"
"${BIN}" \
"-Dconfig.file=${ROOT}/conf/dev.conf" \
"~run ${PORT}"
fi
else
echo "With config ${CONFIG}"
"${BIN}" \
"-Dconfig.file=${CONFIG}" \
"~run ${PORT}"
fi
9 changes: 9 additions & 0 deletions dev_run_stubs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
SCRIPT_PATH=$(cd ${0%/*} && echo $PWD/${0##*/})
ROOT=`dirname "${SCRIPT_PATH}"`

cd "${ROOT}"

echo -ne "\033]2;zaglushka.py for hedgehog\007"
echo -e "Run zaglushka.py ..."
zaglushka.py --ports=8000 "--config=${ROOT}/api_stubs/config.json"

0 comments on commit 69dc012

Please sign in to comment.