-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
128 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
language: ruby | ||
rvm: | ||
- 2.3.0 | ||
- 2.3.1 | ||
script: rspec tests | ||
|
||
notifications: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
ping_url="https://api.rosette.com/rest/v1" | ||
retcode=0 | ||
errors=( "Exception" "processingFailure" ) | ||
errors=( "Exception" "processingFailure" "badRequest" "ParseError" "ValueError" "SyntaxError" "AttributeError" "ImportError" ) | ||
|
||
#------------ Start Functions -------------------------- | ||
|
||
|
@@ -12,11 +12,13 @@ function HELP { | |
echo " API_KEY - Rosette API key (required)" | ||
echo " FILENAME - Ruby source file (optional)" | ||
echo " ALT_URL - Alternate service URL (optional)" | ||
echo " GIT_USERNAME - Git username where you would like to push regenerated gh-pages (optional)" | ||
echo " VERSION - Build version (optional)" | ||
exit 1 | ||
} | ||
|
||
if [ ! -z ${ALT_URL} ]; then | ||
ping_url=${ALT_URL} | ||
fi | ||
|
||
#Checks if Rosette API key is valid | ||
function checkAPI { | ||
match=$(curl "${ping_url}/ping" -H "X-RosetteAPI-Key: ${API_KEY}" | grep -o "forbidden") | ||
|
@@ -55,27 +57,16 @@ function runExample() { | |
#------------ End Functions ---------------------------- | ||
|
||
#Gets API_KEY, FILENAME and ALT_URL if present | ||
while getopts ":API_KEY:FILENAME:ALT_URL:GIT_USERNAME:VERSION" arg; do | ||
while getopts ":API_KEY:FILENAME:ALT_URL" arg; do | ||
case "${arg}" in | ||
API_KEY) | ||
API_KEY=${OPTARG} | ||
usage | ||
;; | ||
ALT_URL) | ||
ALT_URL=${OPTARG} | ||
usage | ||
;; | ||
FILENAME) | ||
FILENAME=${OPTARG} | ||
usage | ||
;; | ||
GIT_USERNAME) | ||
GIT_USERNAME=${OPTARG} | ||
usage | ||
;; | ||
VERSION) | ||
VERSION={OPTARG} | ||
usage | ||
;; | ||
esac | ||
done | ||
|
@@ -93,11 +84,13 @@ gem install ./rosette_api-*.gem | |
if [ ! -z ${API_KEY} ]; then | ||
checkAPI | ||
cd tests | ||
rspec tests_spec.rb | ||
rspec tests_spec.rb --format documentation | ||
cd ../examples | ||
if [ ! -z ${FILENAME} ]; then | ||
echo -e "\nRunning example against: ${ping_url}\n" | ||
runExample ${FILENAME} | ||
else | ||
echo -e "\nRunning examples against: ${ping_url}\n" | ||
for file in *.rb; do | ||
runExample ${file} | ||
done | ||
|
@@ -106,22 +99,4 @@ else | |
HELP | ||
fi | ||
|
||
#Generate gh-pages and push them to git account (if git username is provided) | ||
if [ ! -z ${GIT_USERNAME} ] && [ ! -z ${VERSION} ]; then | ||
#clone ruby git repo | ||
cd / | ||
git clone [email protected]:${GIT_USERNAME}/ruby.git | ||
cd ruby | ||
git checkout origin/gh-pages -b gh-pages | ||
git branch -d develop | ||
#generate gh-pages and set ouput dir to git repo (gh-pages branch) | ||
cd /ruby-dev/lib | ||
rdoc -o /doc | ||
cp -r /doc/. /ruby | ||
cd /ruby | ||
git add . | ||
git commit -a -m "publish ruby apidocs ${VERSION}" | ||
git push | ||
fi | ||
|
||
exit ${retcode} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mock-data/request/entities_linked.json → mock-data/request/entities_no_qids.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"content":"Last month director Paul Feig announced the movie will have an all-star female cast including Kristen Wiig, Melissa McCarthy, Leslie Jones and Kate McKinnon."} | ||
{"content":"Last month director Paul Feig announced the movie will have an all-star female cast including Kristen Wiig, Melissa McCarthy, Leslie Jones and Kate McKinnon.","options":{"linkEntities":false}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s| | |
s.required_ruby_version = '>= 2.0.0' | ||
|
||
s.name = 'rosette_api' | ||
s.version = '1.1.1' | ||
s.version = '1.2.0' | ||
s.license = 'MIT' | ||
|
||
s.summary = 'Rosette API gem that supports multilingual text-analytics.' | ||
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s| | |
s.authors = ['Basis Technology Corp'] | ||
s.email = %q{[email protected]} | ||
s.homepage = %q{https://developer.rosette.com/} | ||
s.date = %q{2016-06-08} | ||
s.date = %q{2016-07-22} | ||
|
||
all_files = `git ls-files -z`.split("\x0") | ||
s.files = all_files.grep(%r{^(bin|lib)/|^.rubocop.yml$}) | ||
|
Oops, something went wrong.