-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Ruby & gems. Add example config
- Loading branch information
Showing
5 changed files
with
38 additions
and
13 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 +1 @@ | ||
ruby-3.0.4 | ||
ruby-3.2.5 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,12 +4,31 @@ A gem for uploading data to the [TeSS](http://tess.elixir-uk.org) portal. Use if | |
## Get Started | ||
Add the TeSS API to your Gemfile and use bundle to install | ||
|
||
`$ echo "gem 'tess_api_client', :git => git://github.com/ElixirUK/TeSS_api_client.git" >> Gemfile` | ||
echo "gem 'tess_api_client', :git => git://github.com/ElixirUK/TeSS_api_client.git" >> Gemfile | ||
|
||
`$ bundle install` | ||
bundle install | ||
|
||
Create a new ruby script which uses the gem. Use the ContentProvider model to create a new content provider in TeSS and the Material or Event model to create new resources. | ||
`$ nano my_upload_script.rb` | ||
Create a config file containing the TeSS instance info & your TeSS credentials (uses <https://dev.tess.elixir-europe.org> by default): | ||
|
||
cp uploader_config.example.txt uploader_config.txt | ||
|
||
nano uploader_config.txt | ||
|
||
...OR configure in your code: | ||
|
||
```ruby | ||
Tess::API.config = { | ||
'host' => 'dev.tess.elixir-europe.org', | ||
'port' => '443', | ||
'protocol' => 'https', | ||
'user_email' => '[email protected]', | ||
'user_token' => 'MyAPIToken' | ||
} | ||
``` | ||
|
||
Create a new ruby script which uses the gem. Use the ContentProvider model to create a new content provider in TeSS and the Material or Event model to create new resources. | ||
|
||
$ nano my_upload_script.rb | ||
|
||
```ruby | ||
require 'tess_api_client' | ||
|
@@ -30,8 +49,8 @@ material = Tess::API::Material.new( | |
scientific_topic: ['Computational Biology'], | ||
keywords: ['tutorial', 'TeSS', 'sharing']) | ||
|
||
material.create | ||
material.create_or_update # Creates the material, or updates the existing entry if it already exists | ||
``` | ||
|
||
## Futher Examples | ||
## Further Examples | ||
More examples can be found in the `test` directory of this repository, or in the [TeSS Scrapers repository](https://github.com/ElixirTeSS/TeSS_scrapers) |
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,19 +1,19 @@ | ||
Gem::Specification.new do |s| | ||
s.name = 'tess_api_client' | ||
s.version = '0.4.2' | ||
s.date = '2022-07-28' | ||
s.version = '0.4.3' | ||
s.date = '2024-12-12' | ||
s.summary = 'Libraries for uploading files to https://github.com/ElixirTeSS/TeSS' | ||
s.description = 'Uses the a Custom RoR API on https://tess.elixir-europe.org to upload data in the format being used by the TeSS project.' | ||
s.description = 'Uses the legacy JSON API on https://tess.elixir-europe.org' | ||
s.authors = ['Milo Thurston','Niall Beard','Aleksandra Nenadic','Finn Bacall'] | ||
s.email = '[email protected]' | ||
s.files = `git ls-files`.split("\n") | ||
s.homepage = 'https://github.com/ElixirTeSS/TeSS_api_client' | ||
s.license = 'BSD' | ||
s.add_runtime_dependency 'inifile', '~> 3.0.0' | ||
s.add_runtime_dependency 'rest-client', '~> 2.0.0' | ||
s.add_runtime_dependency 'rest-client', '~> 2.1.0' | ||
s.add_development_dependency 'rake' | ||
s.add_development_dependency 'webmock' | ||
s.add_development_dependency 'vcr', '~> 3.0.3' | ||
s.add_development_dependency 'vcr', '~> 6.2.0' | ||
s.add_development_dependency 'test-unit', '~> 3.5.3' | ||
s.add_development_dependency 'simplecov' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Main] | ||
host = dev.tess.elixir-europe.org | ||
protocol = https | ||
port = 443 | ||
user_token = my_secret_api_string | ||
user_email = [email protected] | ||
debug = false |