metamolecular-chemcaster 0.1.6 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +43 -3
- data/lib/chemcaster/component.rb +6 -0
- data/lib/chemcaster/image.rb +1 -1
- data/lib/chemcaster/index.rb +1 -1
- data/lib/chemcaster/query.rb +2 -2
- data/lib/chemcaster/registration.rb +8 -0
- data/lib/chemcaster/registry.rb +2 -1
- data/lib/chemcaster/service.rb +2 -12
- data/lib/chemcaster/structure.rb +2 -2
- data/lib/chemcaster.rb +5 -0
- metadata +5 -2
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= Chemcaster Ruby API
|
1
|
+
= Chemcaster[http://chemcaster.com] Ruby API
|
2
2
|
|
3
3
|
This is the Ruby interface for the Chemcaster[http://chemcaster.com] RESTful Web
|
4
4
|
API. It consists of basic functionality needed to create
|
@@ -24,7 +24,24 @@ Installation through the Ruby Gem hosted on GitHub is recommended:
|
|
24
24
|
|
25
25
|
service = Chemcaster::Service.connect 'username', 'password'
|
26
26
|
|
27
|
-
|
27
|
+
Because Chemcaster[http://chemcaster.com] authenticates using SSL, you'll need to make sure the
|
28
|
+
Ruby HTTP library can find the root SSL certificates on your system. On
|
29
|
+
Debian Linux systems, these files are found in /etc/ssl/certs. This is
|
30
|
+
also the default location used by the Chemcaster Ruby Client.
|
31
|
+
|
32
|
+
To override the default SSL certificates path, pass the +root_ca+ option to the
|
33
|
+
+connect+ method:
|
34
|
+
|
35
|
+
service = Chemcaster::Service.connect 'username', 'password',
|
36
|
+
:root_ca => 'path/to/root_ssl_certs'
|
37
|
+
|
38
|
+
More information can be found here:
|
39
|
+
|
40
|
+
* {Making an HTTPS Web Request}[http://codeidol.com/other/rubyckbk/Internet-Services/Making-an-HTTPS-Web-Request]
|
41
|
+
* {SSL Certificates and Net::HTTPS}[http://redcorundum.blogspot.com/2008/03/ssl-certificates-and-nethttps.html]
|
42
|
+
* {Verified HTTPS in Ruby}[http://notetoself.vrensk.com/2008/09/verified-https-in-ruby]
|
43
|
+
|
44
|
+
=== Loading a Registry from a Listing
|
28
45
|
|
29
46
|
require 'rubygems'
|
30
47
|
require 'chemcaster'
|
@@ -34,6 +51,23 @@ Installation through the Ruby Gem hosted on GitHub is recommended:
|
|
34
51
|
registries.size # => 3
|
35
52
|
registry = registries[0]
|
36
53
|
|
54
|
+
=== Loading a Registry from a URI
|
55
|
+
|
56
|
+
require 'rubygems'
|
57
|
+
require 'chemcaster'
|
58
|
+
|
59
|
+
Chemcaster::Service.connect 'username', 'password'
|
60
|
+
|
61
|
+
link = Chemcaster::Link.new 'name'=> 'foo',
|
62
|
+
'uri' => 'https://chemcaster.com/registries/123456',
|
63
|
+
'media_type' => 'application/vnd.com.chemcaster.Registry+json'
|
64
|
+
registry = link.get
|
65
|
+
|
66
|
+
Note: No assumptions should be made about Chemcaster[http://chemcaster.com] URI layout. Once
|
67
|
+
you receive a resource URI, you can expect it to work at any point
|
68
|
+
in the future for random-access. But URI templates are unnecessary
|
69
|
+
when accessing resources.
|
70
|
+
|
37
71
|
=== Creating a Registry
|
38
72
|
|
39
73
|
require 'rubygems'
|
@@ -51,4 +85,10 @@ Installation through the Ruby Gem hosted on GitHub is recommended:
|
|
51
85
|
|
52
86
|
service = Chemcaster::Service.connect 'username', 'password'
|
53
87
|
registry = service.registries[0]
|
54
|
-
registry.update :name => 'CarboBlocks International, Inc.'
|
88
|
+
registry.update :name => 'CarboBlocks International, Inc.'
|
89
|
+
|
90
|
+
|
91
|
+
== API Documentation
|
92
|
+
|
93
|
+
RDoc documentation is available at
|
94
|
+
{rdoc.info}[http://rdoc.info/projects/metamolecular/chemcaster-ruby].
|
data/lib/chemcaster/image.rb
CHANGED
data/lib/chemcaster/index.rb
CHANGED
data/lib/chemcaster/query.rb
CHANGED
data/lib/chemcaster/registry.rb
CHANGED
data/lib/chemcaster/service.rb
CHANGED
@@ -2,7 +2,8 @@ require File.dirname(__FILE__) + '/../chemcaster/representation'
|
|
2
2
|
|
3
3
|
module Chemcaster
|
4
4
|
class Service < Representation
|
5
|
-
|
5
|
+
attributes :version
|
6
|
+
resources :registries
|
6
7
|
|
7
8
|
# Ruby SSL needs to be told the location of the system's SSL CA files.
|
8
9
|
# On Debian Linux systems, these files are located at /etc/ssl/certs,
|
@@ -26,16 +27,5 @@ module Chemcaster
|
|
26
27
|
'media_type' => 'application/vnd.com.chemcaster.Service+json', 'name' => 'root'
|
27
28
|
service_link.get
|
28
29
|
end
|
29
|
-
|
30
|
-
def registries
|
31
|
-
@registries_link.get
|
32
|
-
end
|
33
|
-
|
34
|
-
protected
|
35
|
-
|
36
|
-
def load_hash hash
|
37
|
-
super
|
38
|
-
@registries_link = Link.new hash['registries']
|
39
|
-
end
|
40
30
|
end
|
41
31
|
end
|
data/lib/chemcaster/structure.rb
CHANGED
data/lib/chemcaster.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
require File.dirname(__FILE__) + "/chemcaster/service"
|
2
2
|
require File.dirname(__FILE__) + '/chemcaster/service'
|
3
3
|
require File.dirname(__FILE__) + '/chemcaster/registry'
|
4
|
+
require File.dirname(__FILE__) + '/chemcaster/registration'
|
4
5
|
require File.dirname(__FILE__) + '/chemcaster/structure'
|
6
|
+
require File.dirname(__FILE__) + '/chemcaster/substance'
|
7
|
+
require File.dirname(__FILE__) + '/chemcaster/component'
|
5
8
|
require File.dirname(__FILE__) + '/chemcaster/query'
|
6
9
|
require File.dirname(__FILE__) + '/chemcaster/image'
|
10
|
+
require File.dirname(__FILE__) + '/chemcaster/execution'
|
11
|
+
require File.dirname(__FILE__) + '/chemcaster/archive'
|
7
12
|
require File.dirname(__FILE__) + '/chemcaster/link'
|
8
13
|
require File.dirname(__FILE__) + '/chemcaster/index'
|
9
14
|
require File.dirname(__FILE__) + '/chemcaster/item'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metamolecular-chemcaster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Apodaca
|
@@ -45,8 +45,11 @@ files:
|
|
45
45
|
- lib/chemcaster/representation.rb
|
46
46
|
- lib/chemcaster/service.rb
|
47
47
|
- lib/chemcaster/structure.rb
|
48
|
+
- lib/chemcaster/registration.rb
|
49
|
+
- lib/chemcaster/component.rb
|
48
50
|
has_rdoc: false
|
49
51
|
homepage: http://chemcaster.com
|
52
|
+
licenses:
|
50
53
|
post_install_message:
|
51
54
|
rdoc_options: []
|
52
55
|
|
@@ -67,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
70
|
requirements: []
|
68
71
|
|
69
72
|
rubyforge_project:
|
70
|
-
rubygems_version: 1.
|
73
|
+
rubygems_version: 1.3.5
|
71
74
|
signing_key:
|
72
75
|
specification_version: 2
|
73
76
|
summary: A hypertext-driven Ruby client for the Chemcaster cheminformatics Web services platform. End.
|