{"id":21496576,"url":"https://github.com/mlibrary/turnsole","last_synced_at":"2025-03-17T12:16:12.622Z","repository":{"id":47446137,"uuid":"140770982","full_name":"mlibrary/turnsole","owner":"mlibrary","description":"Ruby Heliotrope REST API scripting examples.","archived":false,"fork":false,"pushed_at":"2024-05-16T19:20:31.000Z","size":62,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-01-23T21:53:30.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlibrary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-12T22:34:53.000Z","updated_at":"2022-03-07T13:56:00.000Z","dependencies_parsed_at":"2022-09-15T21:53:09.377Z","dependency_job_id":null,"html_url":"https://github.com/mlibrary/turnsole","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlibrary%2Fturnsole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlibrary%2Fturnsole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlibrary%2Fturnsole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlibrary%2Fturnsole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlibrary","download_url":"https://codeload.github.com/mlibrary/turnsole/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244031154,"owners_count":20386534,"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":[],"created_at":"2024-11-23T16:17:23.203Z","updated_at":"2025-03-17T12:16:12.565Z","avatar_url":"https://github.com/mlibrary.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Turnsole\n\n[![Coverage Status](https://coveralls.io/repos/github/mlibrary/turnsole/badge.svg?branch=master)](https://coveralls.io/github/mlibrary/turnsole?branch=master)\n\nWelcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/turnsole`. To experiment with that code, run `bin/console` for an interactive prompt.\n\nInclude the **Turnsole** gem in your Ruby shell scripts that query your [Heliotrope](https://github.com/mlibrary/heliotrope) application's REST API.\n  \n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'turnsole'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install turnsole\n\n## Usage\n\nAdd these variables to your environment:\n\n\texport TURNSOLE_HELIOTROPE_API=http://localhost:3000/api\n\texport TURNSOLE_HELIOTROPE_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6Imdrb3N0aW5AdW1pY2guZWR1IiwicGluIjoiJDJhJDEwJElmcTNWTUt1YVd1eTIxWVM1Rk0ucnU5RExDemZuNWRyYS54OGgwZDJhcms3dFVhTkxHNnoyIn0.67Uk4mvM_ZuXn7YpYXPIdd7ygTBKaL_Er6fx2HM_AXg\n\n**TURNSOLE_HELIOTROPE_API** is the URL to your [Heliotrope](https://github.com/mlibrary/heliotrope) application's API endpoint.\n\n**TURNSOLE_HELIOTROPE_TOKEN** is the [JSON Web Token](https://jwt.io/) for your user account.\n\n## Examples\n\n### Handle Service\n\n\t$ ./bin/handle --help\n\tUsage: ./bin/handle noid\n\t\t-h, --help                       Print this help message\n\nConverts a [noid](https://github.com/samvera/noid-rails) into a path, url, and retrieves its value\n        \n\t$ ./bin/handle validnoid\n\tnoid: validnoid\n\tpath: 2027/fulcrum.validnoid\n\turl: https://hdl.handle.net/2027/fulcrum.validnoid\n\tvalue: 100 : Handle Not Found. (HTTP 404 Not Found)\n\n### Heliotrope Service\n\n\t$ ./bin/heliotrope --help\n\tUsage: ./bin/heliotrope -v -p -c -d -s -g [-b \u003cbase\u003e] [-t \u003ctoken\u003e]\n    \t-v, --verbose                    Verbose\n    \t-p, --products                   Products\n    \t-c, --components                 Components\n    \t-d, --individuals                Individuals\n    \t-s, --institutions               Institutions\n    \t-g, --grants                     Grants\n    \t-b, --base [url]                 URL to api\n    \t-t, --token [jwt]                JWT token\n    \t-h, --help                       Print this help message\n    \nLists products, components, individuals, institutions and grants in your [Heliotrope](https://github.com/mlibrary/heliotrope) application.\n        \n\t$ ./bin/heliotrope -p\n\t{\"products\"=\u003e[{\"id\"=\u003e118, \"identifier\"=\u003e\"product\", \"name\"=\u003e\"Product\", \"purchase\"=\u003e\"https::/purchase.com/product\", \"url\"=\u003e\"http://localhost:3000/products/118.json\"}]}\n\nNOTE: **base** and **token** were obtained from the shell environment variables **TURNSOLE_HELIOTROPE_API** and **TURNSOLE_HELIOTROPE_TOKEN** respectively.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\nNOTE: To get passing specs with `rake spec` you'll need to have a running development instance of [Heliotrope](https://github.com/mlibrary/heliotrope)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/mlibrary/turnsole. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Turnsole project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mlibrary/turnsole/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlibrary%2Fturnsole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlibrary%2Fturnsole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlibrary%2Fturnsole/lists"}