glycobook 0.1.0.alpha.13-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: b6597991ee22be9f80490074af766e649928da064481acc7cec61696beda9212
4
- data.tar.gz: 84ff7fb0d1e34c14b2ba60e42870e96aa01080a9bd4aa96e9ac18610c93eadb2
3
+ metadata.gz: 9783edf50dd8884c859bd729245b8db2bfd1b460f9d492decb8b53b888aed05d
4
+ data.tar.gz: 763879fa7da8fd5d0d846eaa327970d426f689fe5426540616889742dc15f6fc
5
5
  SHA512:
6
- metadata.gz: 3d97a3ebcd70fac044adc0d16989da2f9ee8042f4d65b4f18977cd91df7e4216a724a6a9de34211ac22837b796ae69b6952589624060a392faae21b72d471316
7
- data.tar.gz: 66c04e3a9fd53e7d5c5ae219664c0100b2fe18e7d3b31f5deb243d8abcca109c111dabbabfa58964af819c633b2a4caa0bf0d7355b100aca8d655c7881aaf587
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"
@@ -1,23 +1,33 @@
1
1
  require 'java'
2
2
  require 'logger'
3
3
  require_relative '../jar/slf4j-api.jar'
4
+ require_relative '../jar/slf4j-simple.jar'
5
+
4
6
  java_import 'org.slf4j.LoggerFactory'
5
7
 
8
+ module GlycoBook
6
9
  class JRubySLF4JLogger < Logger
7
10
  def initialize(name)
8
- super(STDOUT) # STDOUTはダミー、実際のログはSLF4Jを通じて行われる
11
+ super(STDOUT) # STDOUT is dummy
9
12
  @java_logger = LoggerFactory.getLogger(name)
10
13
  end
14
+ def add(severity, message , progname , &block)
15
+
16
+ message = block.call if block
17
+ message = message.to_s
11
18
 
12
- def add(severity, message = nil, progname = nil)
13
- # Rubyのログレベルに応じてJavaのSLF4Jメソッドを呼び出す
14
- case severity
15
- when Logger::INFO
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
16
29
  @java_logger.info(message)
17
- # 他のログレベルについても同様に実装
18
30
  end
19
31
  end
20
32
  end
21
-
22
- logger = JRubySLF4JLogger.new("MyLogger")
23
- logger.info("This is an info message from JRuby with SLF4J")
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'
@@ -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
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.13
4
+ version: 0.1.0.alpha.14
5
5
  platform: java
6
6
  authors:
7
7
  - Akihiro Fujita