-
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
8 changed files
with
169 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
node { | ||
def SOURCEDIR = pwd() | ||
try { | ||
stage("Clean up") { | ||
step([$class: 'WsCleanup']) | ||
} | ||
stage("Checkout Code") { | ||
checkout scm | ||
} | ||
stage("Test with Docker") { | ||
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${env.BINDING_TEST_URL}"]) { | ||
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosetteapi/docker-ruby" | ||
} | ||
} | ||
slack(true) | ||
} catch (e) { | ||
currentBuild.result = "FAILED" | ||
slack(false) | ||
throw e | ||
} | ||
} | ||
|
||
def slack(boolean success) { | ||
def color = success ? "#00FF00" : "#FF0000" | ||
def status = success ? "SUCCESSFUL" : "FAILED" | ||
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})" | ||
slackSend(color: color, channel: "#rapid", message: message) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
node { | ||
def SOURCEDIR = pwd() | ||
def TEST_CONTAINER = 'examples/ruby-test' | ||
def DOCKERFILE_DIR = './examples/docker' | ||
try { | ||
stage("Clean up") { | ||
step([$class: 'WsCleanup']) | ||
} | ||
stage("Checkout Code") { | ||
checkout scm | ||
} | ||
stage("Build Dockerfile") { | ||
dir ("${DOCKERFILE_DIR}") { | ||
docker.build("${TEST_CONTAINER}") | ||
} | ||
} | ||
stage("Run Examples") { | ||
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${env.BINDING_TEST_URL}"]) { | ||
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source ${TEST_CONTAINER}" | ||
} | ||
} | ||
slack(true) | ||
} catch (e) { | ||
currentBuild.result = "FAILED" | ||
slack(false) | ||
throw e | ||
} | ||
} | ||
|
||
def slack(boolean success) { | ||
def color = success ? "#00FF00" : "#FF0000" | ||
def status = success ? "SUCCESSFUL" : "FAILED" | ||
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})" | ||
slackSend(color: color, channel: "#rapid", message: message) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'rosette_api' | ||
|
||
api_key, url = ARGV | ||
|
||
if !url | ||
rosette_api = RosetteAPI.new(api_key) | ||
else | ||
rosette_api = RosetteAPI.new(api_key, url) | ||
end | ||
|
||
topics_data = "Lily Collins is in talks to join Nicholas Hoult in Chernin Entertainment and Fox Searchlight's J.R.R. Tolkien biopic Tolkien. Anthony Boyle, known for playing Scorpius Malfoy in the British play Harry Potter and the Cursed Child, also has signed on for the film centered on the famed author. In Tolkien, Hoult will play the author of the Hobbit and Lord of the Rings book series that were later adapted into two Hollywood trilogies from Peter Jackson. Dome Karukoski is directing the project." | ||
begin | ||
params = DocumentParameters.new(content: topics_data) | ||
response = rosette_api.get_topics(params) | ||
puts JSON.pretty_generate(response) | ||
rescue RosetteAPIError => rosette_api_error | ||
printf('Rosette API Error (%s): %s', rosette_api_error.status_code, rosette_api_error.message) | ||
end |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s| | |
s.required_ruby_version = '>= 2.0.0' | ||
|
||
s.name = 'rosette_api' | ||
s.version = '1.7.0' | ||
s.version = '1.8.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{2017-06-14} | ||
s.date = %q{2017-10-24} | ||
|
||
all_files = `git ls-files -z`.split("\x0") | ||
s.files = all_files.grep(%r{^(bin|lib)/|^.rubocop.yml$}) | ||
|
Oops, something went wrong.