cheminee 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +72 -0
- data/README.md +90 -0
- data/Rakefile +10 -0
- data/cheminee.gemspec +38 -0
- data/docs/DefaultApi.md +70 -0
- data/docs/Smile.md +18 -0
- data/docs/StandardizedSmile.md +20 -0
- data/git_push.sh +57 -0
- data/lib/cheminee/api/default_api.rb +86 -0
- data/lib/cheminee/api_client.rb +391 -0
- data/lib/cheminee/api_error.rb +58 -0
- data/lib/cheminee/configuration.rb +290 -0
- data/lib/cheminee/models/smile.rb +221 -0
- data/lib/cheminee/models/standardized_smile.rb +223 -0
- data/lib/cheminee/version.rb +15 -0
- data/lib/cheminee.rb +42 -0
- data/openapi-generator-config.json +7 -0
- data/openapi.json +77 -0
- data/pkg/cheminee-0.0.15.gem +0 -0
- data/spec/api/default_api_spec.rb +45 -0
- data/spec/api_client_spec.rb +228 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/smile_spec.rb +34 -0
- data/spec/models/standardized_smile_spec.rb +40 -0
- data/spec/spec_helper.rb +111 -0
- metadata +115 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 706c2ab9f2aa12e134bd1abd45903bc875cae5395c5807440df94eef33bf5d9f
|
4
|
+
data.tar.gz: '079fbe772ea29abf9d042a439e0a38d26b0d5c5192897e8d07e8a08c9280563f'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bc6a0005d9bc67f6a9a8224e1a293e615fada51873b3a3d2ca06bfabe906538051e0d3c09530dcb0727cdad7cf27bdd25655ebe6e3791ab64c89c5171bcc34f4
|
7
|
+
data.tar.gz: ecfcf0007f6521245c975d92000e5736f456d3ad16e57d165cd729fd94cd3e93f64819092fc662fef4b019d8f4e308c12a0432140577dc13b2568e74a7c4743f
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cheminee (0.0.15)
|
5
|
+
typhoeus (~> 1.0, >= 1.0.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.2)
|
11
|
+
byebug (11.1.3)
|
12
|
+
coderay (1.1.3)
|
13
|
+
diff-lcs (1.5.0)
|
14
|
+
ethon (0.16.0)
|
15
|
+
ffi (>= 1.15.0)
|
16
|
+
ffi (1.15.5)
|
17
|
+
jaro_winkler (1.5.6)
|
18
|
+
method_source (1.0.0)
|
19
|
+
parallel (1.23.0)
|
20
|
+
parser (3.2.2.3)
|
21
|
+
ast (~> 2.4.1)
|
22
|
+
racc
|
23
|
+
pry (0.14.2)
|
24
|
+
coderay (~> 1.1)
|
25
|
+
method_source (~> 1.0)
|
26
|
+
pry-byebug (3.10.1)
|
27
|
+
byebug (~> 11.0)
|
28
|
+
pry (>= 0.13, < 0.15)
|
29
|
+
psych (5.1.0)
|
30
|
+
stringio
|
31
|
+
racc (1.7.1)
|
32
|
+
rainbow (3.1.1)
|
33
|
+
rake (13.0.6)
|
34
|
+
rspec (3.12.0)
|
35
|
+
rspec-core (~> 3.12.0)
|
36
|
+
rspec-expectations (~> 3.12.0)
|
37
|
+
rspec-mocks (~> 3.12.0)
|
38
|
+
rspec-core (3.12.2)
|
39
|
+
rspec-support (~> 3.12.0)
|
40
|
+
rspec-expectations (3.12.3)
|
41
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
+
rspec-support (~> 3.12.0)
|
43
|
+
rspec-mocks (3.12.6)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.12.0)
|
46
|
+
rspec-support (3.12.1)
|
47
|
+
rubocop (0.66.0)
|
48
|
+
jaro_winkler (~> 1.5.1)
|
49
|
+
parallel (~> 1.10)
|
50
|
+
parser (>= 2.5, != 2.5.1.1)
|
51
|
+
psych (>= 3.1.0)
|
52
|
+
rainbow (>= 2.2.2, < 4.0)
|
53
|
+
ruby-progressbar (~> 1.7)
|
54
|
+
unicode-display_width (>= 1.4.0, < 1.6)
|
55
|
+
ruby-progressbar (1.13.0)
|
56
|
+
stringio (3.0.8)
|
57
|
+
typhoeus (1.4.0)
|
58
|
+
ethon (>= 0.9.0)
|
59
|
+
unicode-display_width (1.5.0)
|
60
|
+
|
61
|
+
PLATFORMS
|
62
|
+
x86_64-linux
|
63
|
+
|
64
|
+
DEPENDENCIES
|
65
|
+
cheminee!
|
66
|
+
pry-byebug
|
67
|
+
rake (~> 13.0.1)
|
68
|
+
rspec (~> 3.6, >= 3.6.0)
|
69
|
+
rubocop (~> 0.66.0)
|
70
|
+
|
71
|
+
BUNDLED WITH
|
72
|
+
2.4.10
|
data/README.md
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
# cheminee
|
2
|
+
|
3
|
+
Cheminee - the Ruby gem for the Cheminée
|
4
|
+
|
5
|
+
Cheminée: The Chemical Structure Search Engine
|
6
|
+
|
7
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
|
+
|
9
|
+
- API version: 1.0
|
10
|
+
- Package version: 0.0.15
|
11
|
+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
|
+
For more information, please visit [https://github.com/rdkit-rs/cheminee](https://github.com/rdkit-rs/cheminee)
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
### Build a gem
|
17
|
+
|
18
|
+
To build the Ruby code into a gem:
|
19
|
+
|
20
|
+
```shell
|
21
|
+
gem build cheminee.gemspec
|
22
|
+
```
|
23
|
+
|
24
|
+
Then either install the gem locally:
|
25
|
+
|
26
|
+
```shell
|
27
|
+
gem install ./cheminee-0.0.15.gem
|
28
|
+
```
|
29
|
+
|
30
|
+
(for development, run `gem install --dev ./cheminee-0.0.15.gem` to install the development dependencies)
|
31
|
+
|
32
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
|
+
|
34
|
+
Finally add this to the Gemfile:
|
35
|
+
|
36
|
+
gem 'cheminee', '~> 0.0.15'
|
37
|
+
|
38
|
+
### Install from Git
|
39
|
+
|
40
|
+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
41
|
+
|
42
|
+
gem 'cheminee', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
43
|
+
|
44
|
+
### Include the Ruby code directly
|
45
|
+
|
46
|
+
Include the Ruby code directly using `-I` as follows:
|
47
|
+
|
48
|
+
```shell
|
49
|
+
ruby -Ilib script.rb
|
50
|
+
```
|
51
|
+
|
52
|
+
## Getting Started
|
53
|
+
|
54
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
# Load the gem
|
58
|
+
require 'cheminee'
|
59
|
+
|
60
|
+
api_instance = Cheminee::DefaultApi.new
|
61
|
+
smile = [Cheminee::Smile.new({smile: 'smile_example'})] # Array<Smile> |
|
62
|
+
|
63
|
+
begin
|
64
|
+
result = api_instance.standardize_post(smile)
|
65
|
+
p result
|
66
|
+
rescue Cheminee::ApiError => e
|
67
|
+
puts "Exception when calling DefaultApi->standardize_post: #{e}"
|
68
|
+
end
|
69
|
+
|
70
|
+
```
|
71
|
+
|
72
|
+
## Documentation for API Endpoints
|
73
|
+
|
74
|
+
All URIs are relative to *http://localhost:3000/api/v1*
|
75
|
+
|
76
|
+
Class | Method | HTTP request | Description
|
77
|
+
------------ | ------------- | ------------- | -------------
|
78
|
+
*Cheminee::DefaultApi* | [**standardize_post**](docs/DefaultApi.md#standardize_post) | **POST** /standardize |
|
79
|
+
|
80
|
+
|
81
|
+
## Documentation for Models
|
82
|
+
|
83
|
+
- [Cheminee::Smile](docs/Smile.md)
|
84
|
+
- [Cheminee::StandardizedSmile](docs/StandardizedSmile.md)
|
85
|
+
|
86
|
+
|
87
|
+
## Documentation for Authorization
|
88
|
+
|
89
|
+
Endpoints do not require authorization.
|
90
|
+
|
data/Rakefile
ADDED
data/cheminee.gemspec
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#Cheminée
|
5
|
+
|
6
|
+
#Cheminée: The Chemical Structure Search Engine
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0
|
9
|
+
|
10
|
+
Generated by: https://openapi-generator.tech
|
11
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "cheminee/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "cheminee"
|
20
|
+
s.version = Cheminee::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["Xavier Lange"]
|
23
|
+
s.email = ["xrlange@gmail.com"]
|
24
|
+
s.homepage = "https://github.com/rdkit-rs/cheminee-ruby"
|
25
|
+
s.summary = "Cheminée Ruby Gem"
|
26
|
+
s.description = "Cheminée: The Chemical Structure Search Engine"
|
27
|
+
s.license = "Unlicense"
|
28
|
+
s.required_ruby_version = ">= 3.0"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
+
|
32
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
33
|
+
|
34
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
35
|
+
s.test_files = `find spec/*`.split("\n")
|
36
|
+
s.executables = []
|
37
|
+
s.require_paths = ["lib"]
|
38
|
+
end
|
data/docs/DefaultApi.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# Cheminee::DefaultApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost:3000/api/v1*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**standardize_post**](DefaultApi.md#standardize_post) | **POST** /standardize | |
|
8
|
+
|
9
|
+
|
10
|
+
## standardize_post
|
11
|
+
|
12
|
+
> <Array<StandardizedSmile>> standardize_post(smile)
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
### Examples
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require 'time'
|
20
|
+
require 'cheminee'
|
21
|
+
|
22
|
+
api_instance = Cheminee::DefaultApi.new
|
23
|
+
smile = [Cheminee::Smile.new({smile: 'smile_example'})] # Array<Smile> |
|
24
|
+
|
25
|
+
begin
|
26
|
+
|
27
|
+
result = api_instance.standardize_post(smile)
|
28
|
+
p result
|
29
|
+
rescue Cheminee::ApiError => e
|
30
|
+
puts "Error when calling DefaultApi->standardize_post: #{e}"
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
#### Using the standardize_post_with_http_info variant
|
35
|
+
|
36
|
+
This returns an Array which contains the response data, status code and headers.
|
37
|
+
|
38
|
+
> <Array(<Array<StandardizedSmile>>, Integer, Hash)> standardize_post_with_http_info(smile)
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
begin
|
42
|
+
|
43
|
+
data, status_code, headers = api_instance.standardize_post_with_http_info(smile)
|
44
|
+
p status_code # => 2xx
|
45
|
+
p headers # => { ... }
|
46
|
+
p data # => <Array<StandardizedSmile>>
|
47
|
+
rescue Cheminee::ApiError => e
|
48
|
+
puts "Error when calling DefaultApi->standardize_post_with_http_info: #{e}"
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
### Parameters
|
53
|
+
|
54
|
+
| Name | Type | Description | Notes |
|
55
|
+
| ---- | ---- | ----------- | ----- |
|
56
|
+
| **smile** | [**Array<Smile>**](Smile.md) | | |
|
57
|
+
|
58
|
+
### Return type
|
59
|
+
|
60
|
+
[**Array<StandardizedSmile>**](StandardizedSmile.md)
|
61
|
+
|
62
|
+
### Authorization
|
63
|
+
|
64
|
+
No authorization required
|
65
|
+
|
66
|
+
### HTTP request headers
|
67
|
+
|
68
|
+
- **Content-Type**: application/json; charset=utf-8
|
69
|
+
- **Accept**: application/json; charset=utf-8
|
70
|
+
|
data/docs/Smile.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Cheminee::Smile
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **smile** | **String** | | |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'cheminee'
|
13
|
+
|
14
|
+
instance = Cheminee::Smile.new(
|
15
|
+
smile: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Cheminee::StandardizedSmile
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **smile** | **String** | | [optional] |
|
8
|
+
| **error** | **String** | | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'cheminee'
|
14
|
+
|
15
|
+
instance = Cheminee::StandardizedSmile.new(
|
16
|
+
smile: null,
|
17
|
+
error: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=$(git remote)
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
@@ -0,0 +1,86 @@
|
|
1
|
+
=begin
|
2
|
+
#Cheminée
|
3
|
+
|
4
|
+
#Cheminée: The Chemical Structure Search Engine
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Cheminee
|
16
|
+
class DefaultApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# @param smile [Array<Smile>]
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [Array<StandardizedSmile>]
|
25
|
+
def standardize_post(smile, opts = {})
|
26
|
+
data, _status_code, _headers = standardize_post_with_http_info(smile, opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param smile [Array<Smile>]
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(Array<StandardizedSmile>, Integer, Hash)>] Array<StandardizedSmile> data, response status code and response headers
|
33
|
+
def standardize_post_with_http_info(smile, opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.standardize_post ...'
|
36
|
+
end
|
37
|
+
# verify the required parameter 'smile' is set
|
38
|
+
if @api_client.config.client_side_validation && smile.nil?
|
39
|
+
fail ArgumentError, "Missing the required parameter 'smile' when calling DefaultApi.standardize_post"
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/standardize'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = opts[:query_params] || {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = opts[:header_params] || {}
|
49
|
+
# HTTP header 'Accept' (if needed)
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
content_type = @api_client.select_header_content_type(['application/json; charset=utf-8'])
|
53
|
+
if !content_type.nil?
|
54
|
+
header_params['Content-Type'] = content_type
|
55
|
+
end
|
56
|
+
|
57
|
+
# form parameters
|
58
|
+
form_params = opts[:form_params] || {}
|
59
|
+
|
60
|
+
# http body (model)
|
61
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(smile)
|
62
|
+
|
63
|
+
# return_type
|
64
|
+
return_type = opts[:debug_return_type] || 'Array<StandardizedSmile>'
|
65
|
+
|
66
|
+
# auth_names
|
67
|
+
auth_names = opts[:debug_auth_names] || []
|
68
|
+
|
69
|
+
new_options = opts.merge(
|
70
|
+
:operation => :"DefaultApi.standardize_post",
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => return_type
|
77
|
+
)
|
78
|
+
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug "API called: DefaultApi#standardize_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
+
end
|
83
|
+
return data, status_code, headers
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|