harbor run -t openthoughts/tasktrove-exp-rpt-stack-ruby-v2-stack-ruby-9179harbor download openthoughts/tasktrove-exp-rpt-stack-ruby-v2-stack-ruby-9179Implement Ruby sources under /app/ so that the test file at /tests/test_solution.rb requires and runs cleanly under rspec (or plain ruby if the file uses Test::Unit / minitest).
tests/test_solution.rb)Below is a deterministic summary of what the test file expects. Use this as the source of truth for require-paths and public API. If the original task description below conflicts with this section, prefer this section.
Language: Ruby
Test framework hint: RSpec / minitest (test.sh runs rspec if RSpec/describe is detected, otherwise plain ruby)
Top-level types under test (from describe/RSpec.describe):
JenkinsApi::Client::JobRequired local files (the test issues require '<file>' or require_relative ...; these must exist somewhere on the load path — typically /app/<file>.rb. Common helper files like spec_helper, test_helper, helper may need an empty stub):
../spec_helper../fake_http_responseSymbols the test references that you likely need to define (class/module names not from Ruby/RSpec/Rails stdlib; place under /app/):
FakeResponse — constructed via FakeResponse.new(...) with arities: 1 argJenkinsApi::Client — constructed via JenkinsApi::Client.new(...) with arities: 1 argJenkinsApi::Client::Job — constructed via JenkinsApi::Client::Job.new(...) with arities: 1 argJenkinsApi::Client::PluginSettings::BaseJenkinsApi::Exceptions::NotFound — constructed via JenkinsApi::Exceptions::NotFound.new(...) with arities: 1 argNokogiri::XMLNokogiri::XML::Document — constructed via Nokogiri::XML::Document.new(...) with arities: 1 argTimeout::ErrorMethods invoked on instances/objects (you must expose at least these with the indicated arity; return type is inferred from how the test uses the result):
.add_skype_notification(...) — called with: 2 args.at_css(...) — called with: 1 arg.at_least(...) — called with: 1 arg.at_xpath(...) — called with: 1 arg.build_freestyle_config(...) — called with: 1 arg, 2 args, 3 args.change_description(...) — called with: 2 args.copy(...) — called with: 1 arg, 2 args.create_freestyle(...) — called with: 1 arg.create_or_update(...) — called with: 2 args.delete_promote_config(...) — called with: 2 args.enable(...) — called with: 1 arg.expand_path(...) — called with: 2 args.get_builds(...) — called with: 1 arg.get_config(...) — called with: 1 arg.get_current_build_status(...) — called with: 1 arg.get_promote_config(...) — called with: 2 args.get_upstream_projects(...) — called with: 1 arg.list_by_status(...) — called with: 1 arg, 2 args.remove_plugin(...) — called with: 1 arg.restrict_to_node(...) — called with: 2 args.should_receive(...) — called with: 1 arg.stop_build(...) — called with: 1 arg.unblock_build_when_downstream_building(...) — called with: 1 arg.unblock_build_when_upstream_building(...) — called with: 1 arg.unchain(...) — called with: 1 argruby:3.2-slim with build-essential, ruby-dev, libffi-dev for native extensions.rspec, minitest. Other 3rd-party gems (see list above) are best-effort gem install-ed by tests/test.sh before running the test.tests/test.sh) runs bundle install if /app/Gemfile exists, then auto-requires every *.rb file under /app/ (recursively) via $LOAD_PATH.unshift('/app'). So you can place sources at any depth under /app/ as long as relative-require paths resolve.require 'foo/bar' in the test, ensure either the foo gem provides it OR you create /app/foo/bar.rb with the required constants.Task: Implement the JenkinsApi::Client::Job class and supporting helpers under /app/
Overview Build a fully functional Jenkins job management wrapper that integrates with the existing Jenkins API client interface. The class must provide the behaviors exercised by the provided tests, including creating/updating jobs, freestyle job configuration, copying jobs, notifications, job lifecycle actions, configuration retrieval/posting, promotion configuration, SCM helpers, and complex freestyle configuration generation (including artifact archivist and triggers). It must also expose a plugin_collection interface used by tests and support a private helper for SCM git configuration. XML generation should be done with Nokogiri where required by tests (notably for the SCM git helper and freestyle config).
What you need to implement
create(job_name, xml)
create_or_update(job_name, xml)
create_freestyle(params)
copy(from_job, to_job = nil)
add_email_notification(params)
add_skype_notification(params)
rename(old_job, new_job)
delete(job_name)
wipe_out_workspace(job_name)
stop_build(job_name)
get_console_output(job_name, build_number, start, format)
list_all
exists?(job_name)
list_by_status(status, filter = nil)
[... description truncated to fit prompt budget ...]