{"id":20635741,"url":"https://github.com/psu-libraries/scholarsphere-client","last_synced_at":"2025-12-05T06:04:30.551Z","repository":{"id":38294246,"uuid":"236827254","full_name":"psu-libraries/scholarsphere-client","owner":"psu-libraries","description":"Ruby client for interacting with the Scholarsphere REST API","archived":false,"fork":false,"pushed_at":"2023-08-24T01:37:04.000Z","size":6208,"stargazers_count":0,"open_issues_count":8,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-15T01:20:02.954Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psu-libraries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-01-28T19:53:55.000Z","updated_at":"2022-08-11T18:58:39.000Z","dependencies_parsed_at":"2023-07-15T14:21:14.918Z","dependency_job_id":null,"html_url":"https://github.com/psu-libraries/scholarsphere-client","commit_stats":null,"previous_names":["psu-stewardship/scholarsphere-client"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psu-libraries%2Fscholarsphere-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psu-libraries%2Fscholarsphere-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psu-libraries%2Fscholarsphere-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psu-libraries%2Fscholarsphere-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psu-libraries","download_url":"https://codeload.github.com/psu-libraries/scholarsphere-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242650955,"owners_count":20163611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby"],"created_at":"2024-11-16T15:07:01.617Z","updated_at":"2025-12-05T06:04:25.508Z","avatar_url":"https://github.com/psu-libraries.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scholarsphere::Client\n\nRuby client to update and create content in the Scholarsphere repository.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'scholarsphere-client'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install scholarsphere-client\n\n## Usage\n\n### Authentication\n\nObtain an api key, and save it to `config/scholarsphere-client.yml`\n\n    SS4_ENDPOINT:  \"http://scholarsphere/api/v1\"\n    SS_CLIENT_KEY: \"[key]\"\n\nIf you are using a testing instance, you'll need to disable ssl verification:\n    \n    SS_CLIENT_SSL: \"false\"\n\n### Ingesting\n\nSee the `sample.rb` file for an executable example.\n\nTo publish a work:\n\n``` ruby\nmetadata = {\n  work_type: 'dataset',\n  visibility: 'open',\n  rights: 'https://creativecommons.org/licenses/by/4.0/',\n  title: 'Sample Title',\n  description: \"This is a sample work\",\n  published_date: '2010-01-01',\n  creators: [\n    { orcid: '0000-0000-1111-222X' },\n    { psu_id: 'axb123' },\n    { display_name: 'Dr. Unidentified Creator' }\n  ]\n}\n\nfiles = [\n  Pathname.new(\"/path/to/file1.txt\"),\n  Pathname.new(\"/path/to/file2.txt\")\n]\n\ningest = Scholarsphere::Client::Ingest.new(\n  metadata: metadata,\n  files: files,\n  depositor: 'axb123'\n)\n\nresponse = ingest.publish\n\nputs response.body\n```\n\nThe json output should look like:\n    \n    { \n      \"message\": \"Work was successfully created\",\n      \"url\": \"/resources/0797e99c-7d4f-4e05-8bf6-86aea1029a6a\"\n    }\n\n## Documentation\n\nYou can read the [ruby docs](https://www.rubydoc.info/github/psu-libraries/scholarsphere-client/main) for the latest features.\n\n## Testing\n\n### Using an Existing Deployment\n\nRSpec tests are run against saved API responses that are recorded using the VCR gem. If we want to run the test\nsuite against a live instance to see if our client works against a given deployment, update the endpoint in\n`config/scholarsphere-client.yml` and run:\n\n    DISABLE_VCR=true bundle exec rspec\n\n### Updating VCR Files\n\nSimply removing the existing VCR files should be enough to update all the responses. If no yaml file exists for a given\ntest, VCR will record a new one. Be sure to clean up files afterwards using `bin/clean-vcr-files` which will remove\nunnecessary binary data from the responses:\n\n    rm -Rf spec/fixtures/vcr_cassettes\n    bundle exec rspec\n    bin/clean-vcr-files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsu-libraries%2Fscholarsphere-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsu-libraries%2Fscholarsphere-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsu-libraries%2Fscholarsphere-client/lists"}