glycobook 0.1.0.alpha.12-java → 0.1.0.alpha.14-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7eab8ff3d569ae9e3b8ec9e8abee75dc146f893556508f0dbe73a332edf91cb3
4
- data.tar.gz: 107dbcb98ac4fa90c819743960c2218b458e5919cf0a8a112567f5d88642ecef
3
+ metadata.gz: 9783edf50dd8884c859bd729245b8db2bfd1b460f9d492decb8b53b888aed05d
4
+ data.tar.gz: 763879fa7da8fd5d0d846eaa327970d426f689fe5426540616889742dc15f6fc
5
5
  SHA512:
6
- metadata.gz: 6b74b896e0f673f7563cf3266bed4a083bb1d3d52076f8a4cc0df0b27c385d5f6cefe1dec6ff5255bc0c0d58514b19b49cec43f9986f3c3bf415340269ade19f
7
- data.tar.gz: e1b1fe8e756bda718aee3c965c51de801ba34f0a6b39cef5a1c246b026f839cfa403da344286c37bae32ca49e52969d2fede69ba3d8117fad34c10de275a2294
6
+ metadata.gz: 2226714ccd56a84dd8c5977140011983ffc9f5d27c934a78de632e72f2ffbd593e41d6117f0b73575aa88a69526e0d27219849917964f0370b3fac8714f0c379
7
+ data.tar.gz: d8cac73b68d01d07a22a1d90a5188fb987c24253f8d5dec048feee76260892dbd4879714677b8b9fd67d1288e05bde674f0e6ff92b8e9e25ed27010a53e621d8
data/jar.yml CHANGED
@@ -10,8 +10,10 @@ list:
10
10
  file: "jar/wurcsframework-1.2.14.jar"
11
11
  - url: "https://gitlab.com/glycoinfo/wurcsframework/-/package_files/70458150/download"
12
12
  file: "jar/wurcsframework-1.0.1.jar"
13
- - url: "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.7/slf4j-api-2.0.7.jar"
13
+ - url: "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar"
14
14
  file: "jar/slf4j-api.jar"
15
+ - url: "https://repo1.maven.org/maven2/org/slf4j/slf4j-simple/2.0.9/slf4j-simple-2.0.9.jar"
16
+ file: "jar/slf4j-simple-2.0.9.jar"
15
17
  - url: "https://gitlab.glyco.info/glycosmos/subsumption/subsumption/-/package_files/567/download"
16
18
  file: "jar/subsumption.jar"
17
19
  - url: "https://gitlab.glyco.info/glycosmos/glytoucangroup/archetype/lib/-/package_files/489/download"
@@ -0,0 +1,33 @@
1
+ require 'java'
2
+ require 'logger'
3
+ require_relative '../jar/slf4j-api.jar'
4
+ require_relative '../jar/slf4j-simple.jar'
5
+
6
+ java_import 'org.slf4j.LoggerFactory'
7
+
8
+ module GlycoBook
9
+ class JRubySLF4JLogger < Logger
10
+ def initialize(name)
11
+ super(STDOUT) # STDOUT is dummy
12
+ @java_logger = LoggerFactory.getLogger(name)
13
+ end
14
+ def add(severity, message , progname , &block)
15
+
16
+ message = block.call if block
17
+ message = message.to_s
18
+
19
+ case severity
20
+ when 0 # Logger::DEBUG
21
+ @java_logger.debug(message)
22
+ when 1 # Logger::INFO
23
+ @java_logger.info(message)
24
+ when 2 # Logger::WARN
25
+ @java_logger.warn(message)
26
+ when 3, 4# Logger::ERROR, Logger::FATAL
27
+ @java_logger.error(message)
28
+ else
29
+ @java_logger.info(message)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -7,8 +7,6 @@ require_relative '../jar/slf4j-api.jar'
7
7
  java_import 'org.glytoucan.Archetype'
8
8
  java_import 'org.glycoinfo.WURCSFramework.wurcs.graph.WURCSGraph'
9
9
  java_import 'org.glycoinfo.WURCSFramework.util.WURCSException'
10
- java_import 'org.slf4j.Logger'
11
- java_import 'org.slf4j.LoggerFactory'
12
10
 
13
11
  module GlycoBook
14
12
  class GlyTouCan
@@ -2,7 +2,6 @@ require 'java'
2
2
 
3
3
  require_relative '../jar/glycanbuilder2.jar'
4
4
  require_relative '../jar/wurcsframework.jar'
5
- require_relative '../jar/slf4j-api.jar'
6
5
  require_relative "../jar/batik-all.jar"
7
6
 
8
7
  java_import 'java.io.ByteArrayOutputStream'
@@ -2,7 +2,6 @@ require 'java'
2
2
 
3
3
  require_relative '../jar/glycanformatconverter.jar'
4
4
  require_relative '../jar/wurcsframework.jar'
5
- require_relative '../jar/slf4j-api.jar'
6
5
  require_relative "../jar/MolecularFramework.jar"
7
6
 
8
7
  java_import 'org.glycoinfo.GlycanFormatconverter.io.GlycoCT.WURCSToGlycoCT'
@@ -2,7 +2,6 @@ require 'java'
2
2
 
3
3
  require_relative '../jar/subsumption.jar'
4
4
  require_relative '../jar/wurcsframework.jar'
5
- require_relative '../jar/slf4j-api.jar'
6
5
 
7
6
  java_import 'org.glycoinfo.subsumption.manipulation.GraphManager'
8
7
  java_import 'org.glycoinfo.WURCSFramework.wurcs.graph.WURCSGraph'
@@ -57,7 +56,7 @@ class Subsumption
57
56
  end
58
57
  end
59
58
 
60
- java_import 'org.glycoinfo.subsumption.generator.BaseComposition'
59
+ java_import 'org.glycoinfo.subsumption.generator.BaseCompositionWithoutLinkage'
61
60
  def baseComposition(w)
62
61
  g = nil
63
62
  begin
@@ -1,22 +1,23 @@
1
- # lib/my_gem.rb
2
1
  require 'java'
3
- require_relative '../jar/slf4j-api.jar'
2
+
4
3
  module GlycoBook
5
- class WurcsFrameWork
4
+
5
+ class WurcsFrameWork
6
6
  require_relative '../jar/wurcsframework.jar'
7
- java_import 'org.glycoinfo.WURCSFramework.util.validation.WURCSValidator'
8
- java_import 'org.slf4j.Logger'
9
- def validator(w)
10
- validator = WURCSValidator.new
11
- validator.start(w)
12
- reports = {}
13
- reports["VALIDATOR"] = ["WURCSFramework-1.2.14"]
14
- reports["WARNING"] = validator.getReport().hasWarning()
15
- reports["ERROR"] = validator.getReport().hasError()
16
- reports["UNVERIFIABLE"] = validator.getReport().hasUnverifiable()
17
- return {"message" => reports,
7
+ java_import 'org.glycoinfo.WURCSFramework.util.validation.WURCSValidator'
8
+ java_import 'org.slf4j.Logger'
9
+
10
+ def validator(w)
11
+ validator = WURCSValidator.new
12
+ validator.start(w)
13
+ reports = {}
14
+ reports["VALIDATOR"] = ["WURCSFramework-1.2.14"]
15
+ reports["WARNING"] = validator.getReport().hasWarning()
16
+ reports["ERROR"] = validator.getReport().hasError()
17
+ reports["UNVERIFIABLE"] = validator.getReport().hasUnverifiable()
18
+ return {"message" => reports,
18
19
  "StandardWURCS" => validator.getReport().standard_string(),
19
20
  "RESULTS" => validator.getReport().getResults() }
21
+ end
20
22
  end
21
23
  end
22
- end
data/lib/glycobook.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module GlycoBook
2
2
 
3
3
  end
4
+ require 'glycobook/Loggerinit'
4
5
  require 'glycobook/glycan_builder'
5
6
  require 'glycobook/glycan_format_converter'
6
7
  require 'glycobook/gly_tou_can'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glycobook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha.12
4
+ version: 0.1.0.alpha.14
5
5
  platform: java
6
6
  authors:
7
7
  - Akihiro Fujita
@@ -34,6 +34,7 @@ files:
34
34
  - jar.yml
35
35
  - lib/bookinit.rb
36
36
  - lib/glycobook.rb
37
+ - lib/glycobook/Loggerinit.rb
37
38
  - lib/glycobook/gly_tou_can.rb
38
39
  - lib/glycobook/glycan_builder.rb
39
40
  - lib/glycobook/glycan_format_converter.rb