rino 0.1.0

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.
Files changed (87) hide show
  1. data/README +44 -0
  2. data/Rakefile +123 -0
  3. data/ext/extconf.rb +26 -0
  4. data/ext/ruby_inchi_main.so +0 -0
  5. data/ext/src/aux2atom.h +2786 -0
  6. data/ext/src/comdef.h +148 -0
  7. data/ext/src/e_0dstereo.c +3014 -0
  8. data/ext/src/e_0dstereo.h +31 -0
  9. data/ext/src/e_comdef.h +57 -0
  10. data/ext/src/e_ctl_data.h +147 -0
  11. data/ext/src/e_ichi_io.c +498 -0
  12. data/ext/src/e_ichi_io.h +40 -0
  13. data/ext/src/e_ichi_parms.c +37 -0
  14. data/ext/src/e_ichi_parms.h +41 -0
  15. data/ext/src/e_ichicomp.h +50 -0
  16. data/ext/src/e_ichierr.h +40 -0
  17. data/ext/src/e_ichimain.c +593 -0
  18. data/ext/src/e_ichisize.h +43 -0
  19. data/ext/src/e_inchi_atom.c +75 -0
  20. data/ext/src/e_inchi_atom.h +33 -0
  21. data/ext/src/e_inpdef.h +41 -0
  22. data/ext/src/e_mode.h +706 -0
  23. data/ext/src/e_mol2atom.c +649 -0
  24. data/ext/src/e_readinch.c +58 -0
  25. data/ext/src/e_readmol.c +54 -0
  26. data/ext/src/e_readmol.h +180 -0
  27. data/ext/src/e_readstru.c +251 -0
  28. data/ext/src/e_readstru.h +33 -0
  29. data/ext/src/e_util.c +284 -0
  30. data/ext/src/e_util.h +61 -0
  31. data/ext/src/extr_ct.h +251 -0
  32. data/ext/src/ichi.h +206 -0
  33. data/ext/src/ichi_bns.c +7999 -0
  34. data/ext/src/ichi_bns.h +231 -0
  35. data/ext/src/ichican2.c +5000 -0
  36. data/ext/src/ichicano.c +2195 -0
  37. data/ext/src/ichicano.h +49 -0
  38. data/ext/src/ichicans.c +1625 -0
  39. data/ext/src/ichicant.h +379 -0
  40. data/ext/src/ichicomn.h +260 -0
  41. data/ext/src/ichicomp.h +50 -0
  42. data/ext/src/ichidrp.h +119 -0
  43. data/ext/src/ichierr.h +124 -0
  44. data/ext/src/ichiisot.c +101 -0
  45. data/ext/src/ichilnct.c +286 -0
  46. data/ext/src/ichimain.h +132 -0
  47. data/ext/src/ichimak2.c +1189 -0
  48. data/ext/src/ichimake.c +3812 -0
  49. data/ext/src/ichimake.h +205 -0
  50. data/ext/src/ichimap1.c +851 -0
  51. data/ext/src/ichimap2.c +2856 -0
  52. data/ext/src/ichimap4.c +1609 -0
  53. data/ext/src/ichinorm.c +741 -0
  54. data/ext/src/ichinorm.h +67 -0
  55. data/ext/src/ichiparm.c +45 -0
  56. data/ext/src/ichiparm.h +1441 -0
  57. data/ext/src/ichiprt1.c +3612 -0
  58. data/ext/src/ichiprt2.c +1511 -0
  59. data/ext/src/ichiprt3.c +3011 -0
  60. data/ext/src/ichiqueu.c +1003 -0
  61. data/ext/src/ichiring.c +326 -0
  62. data/ext/src/ichiring.h +49 -0
  63. data/ext/src/ichisize.h +35 -0
  64. data/ext/src/ichisort.c +539 -0
  65. data/ext/src/ichister.c +3538 -0
  66. data/ext/src/ichister.h +35 -0
  67. data/ext/src/ichitaut.c +3843 -0
  68. data/ext/src/ichitaut.h +387 -0
  69. data/ext/src/ichitime.h +74 -0
  70. data/ext/src/inchi_api.h +670 -0
  71. data/ext/src/inchi_dll.c +1480 -0
  72. data/ext/src/inchi_dll.h +34 -0
  73. data/ext/src/inchi_dll_main.c +23 -0
  74. data/ext/src/inchi_dll_main.h +31 -0
  75. data/ext/src/inpdef.h +328 -0
  76. data/ext/src/lreadmol.h +1246 -0
  77. data/ext/src/mode.h +706 -0
  78. data/ext/src/ruby_inchi_main.c +558 -0
  79. data/ext/src/runichi.c +4179 -0
  80. data/ext/src/strutil.c +3861 -0
  81. data/ext/src/strutil.h +182 -0
  82. data/ext/src/util.c +1130 -0
  83. data/ext/src/util.h +85 -0
  84. data/lib/clean_tempfile.rb +220 -0
  85. data/lib/rino.rb +111 -0
  86. data/test/test.rb +386 -0
  87. metadata +130 -0
data/README ADDED
@@ -0,0 +1,44 @@
1
+ =Rino - The InChI Library for Ruby
2
+
3
+ Rino is a Ruby library for generating InChI identifiers from
4
+ molfiles. It is a thin wrapper around the C InChI
5
+ toolkit (http://www.iupac.org/inchi/) developed at NIST and
6
+ IUPAC.
7
+
8
+ ==Typical Usage
9
+
10
+ require 'rubygems'
11
+ require_gem 'rino'
12
+
13
+ reader = Rino::MolfileReader.new
14
+ inchi = reader.read(IO.read('benzene.mol'))
15
+
16
+ puts inchi -> 'InChI=1/C6H6/c1-2-4-6-5-3-1/h1-6H'
17
+
18
+ ==Downloading
19
+
20
+ Both a RubyGems installation package and a full source package
21
+ can be obtained from:
22
+
23
+ http://rubyforge.org/projects/rino
24
+
25
+ ==Requirements
26
+
27
+ Rino was developed with Ruby 1.8.4. Earlier versions of Ruby
28
+ may also be compatible.
29
+
30
+ ==Installing
31
+
32
+ The RubyGems package can be installed using the following command
33
+ (as root):
34
+
35
+ gem install rino
36
+
37
+ ==License
38
+ Rino is distributed under the GNU LGPL version 2.1 (see 'LICENSE').
39
+ It contains source code from the InChI software distribution
40
+ version 1.0.0, itself licensed under the LGPL.
41
+
42
+ ==Contact
43
+
44
+ More information can be found at http://rino.rubyforge.org.
data/Rakefile ADDED
@@ -0,0 +1,123 @@
1
+ # =================================
2
+ # Rino - The InChI Toolkit for Ruby
3
+ # =================================
4
+ #
5
+ # Project Info: http://rino.rubyforge.org
6
+ #
7
+ # Copyright (C) 2006 Richard L. Apodaca
8
+ #
9
+ # This library is free software; you can redistribute it and/or
10
+ # modify it under the terms of the GNU Lesser General Public
11
+ # License version 2.1 as published by the Free Software
12
+ # Foundation.
13
+ #
14
+ # This library is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ # Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public
20
+ # License along with this library; if not, write to the Free
21
+ # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
22
+ # Boston, MA 02111-1301, USA.
23
+
24
+ require 'rake'
25
+ require 'rake/testtask'
26
+ require 'rake/rdoctask'
27
+ require 'rake/gempackagetask'
28
+
29
+ PKG_VERSION = "0.1.0"
30
+
31
+ PKG_FILES = FileList[
32
+ "Rakefile", "README",
33
+ "lib/**/*.rb",
34
+ "test/**/*",
35
+ "ext/**/*.h",
36
+ "ext/**/*.c",
37
+ "ext/**/*.so",
38
+ ]
39
+
40
+ #do inchi first, then gem
41
+ task :gem => [:inchi]
42
+
43
+ desc "Default task"
44
+ task :default => [:test]
45
+
46
+ desc "Run unit tests"
47
+ task :test => [:inchi]
48
+
49
+ desc "Build the InChI C library"
50
+ task :inchi do
51
+ Dir.chdir("ext") do
52
+ ruby "extconf.rb"
53
+ system "make"
54
+ end
55
+ end
56
+
57
+ desc "Clean up"
58
+ task :clean do
59
+ Dir.chdir("ext") do
60
+ system("make clean")
61
+ system("rm -f Makefile")
62
+ end
63
+
64
+ rm_rf "doc"
65
+ rm_rf "pkg"
66
+ rm_rf "dist"
67
+ end
68
+
69
+ desc "Create the source distribution"
70
+ task :dist do
71
+ rm_rf "dist"
72
+
73
+ mkdir "dist"
74
+ mkdir "dist/lib"
75
+ mkdir "dist/ext"
76
+ mkdir "dist/ext/src"
77
+ mkdir "dist/test"
78
+
79
+ cp_r Dir.glob('*.rb'), 'dist'
80
+ cp_r Dir.glob('lib/*.rb'), 'dist/lib'
81
+ cp_r Dir.glob('ext/*.rb'), 'dist/ext'
82
+ cp_r Dir.glob('ext/src/*.{c,h,rb}'), 'dist/ext/src'
83
+ cp_r Dir.glob('test/*.rb'), 'dist/test'
84
+ cp 'Rakefile', 'dist'
85
+ cp 'README', 'dist'
86
+ cp 'LICENSE', 'dist'
87
+ end
88
+
89
+ Rake::TestTask.new do |t|
90
+ t.libs << "test"
91
+ t.test_files = FileList['test/test*.rb']
92
+ t.verbose = true
93
+ end
94
+
95
+ Rake::RDocTask.new do |rdoc|
96
+ rdoc.rdoc_dir = 'doc'
97
+ rdoc.title = "Rino"
98
+ rdoc.rdoc_files.include('README')
99
+ rdoc.options << '--line-numbers'
100
+ rdoc.options << '--inline-source'
101
+ rdoc.options << '--main' << 'README'
102
+ rdoc.rdoc_files.include('lib/**/*.rb')
103
+ end
104
+
105
+ spec = Gem::Specification.new do |s|
106
+ s.name = 'rino'
107
+ s.version = PKG_VERSION
108
+ s.author = "Richard Apodaca"
109
+ s.homepage = "http://rino.rubyforge.org"
110
+ s.platform = Gem::Platform::RUBY
111
+ s.require_path = 'lib'
112
+ s.autorequire = 'rino'
113
+ s.has_rdoc = true
114
+ s.files = PKG_FILES
115
+ s.extensions << 'ext/extconf.rb'
116
+ s.summary = "A Ruby wrapper for the C InChI toolkit"
117
+ end
118
+
119
+ Rake::GemPackageTask.new(spec) do |pkg|
120
+ pkg.need_tar = true
121
+ pkg.need_tar_gz = true
122
+ pkg.package_files += PKG_FILES
123
+ end
data/ext/extconf.rb ADDED
@@ -0,0 +1,26 @@
1
+ # =================================
2
+ # Rino - The InChI Toolkit for Ruby
3
+ # =================================
4
+ #
5
+ # Project Info: http://rino.rubyforge.org
6
+ #
7
+ # Copyright (C) 2006 Richard L. Apodaca
8
+ #
9
+ # This library is free software; you can redistribute it and/or
10
+ # modify it under the terms of the GNU Lesser General Public
11
+ # License version 2.1 as published by the Free Software
12
+ # Foundation.
13
+ #
14
+ # This library is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ # Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public
20
+ # License along with this library; if not, write to the Free
21
+ # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
22
+ # Boston, MA 02111-1301, USA.
23
+
24
+ require 'mkmf'
25
+
26
+ create_makefile("ruby_inchi_main", "src")
Binary file