relaton-xsf 1.14.0 → 1.16.1

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: 57967099fd01cd6118a6af5300a6e64e02f4e9469dec76a856b6e34be6aa744e
4
- data.tar.gz: b1d20c686eca06489fb63cc9e7a651c8fc58a36b0b86564587d259f78fff679a
3
+ metadata.gz: 6dfec87ce4230c11a74b0d3bb28fb0b8935d3647a5e592df6fdbde69ab1d21b8
4
+ data.tar.gz: 1dc23f525f5b3db29fc8f204c70b0004137d0bbb8a068e593b21c180ff247dad
5
5
  SHA512:
6
- metadata.gz: 159d02d559ae64e01e86be9b0742a2cf4b8c87a280146e8aa40152de5dbf70e92bba9fdc23b3ebd6586259b4862528f9343ede2ff3d5ccce11f8d5fb853201f0
7
- data.tar.gz: 37014f915743509729b8d19aed0a0294ef0d9c7fadabd754fde0da0b6376f1bab0c2a36d8cb81e86d30b017f72904a1d4c4c05c70c3e5b78f930c94dea9fc9d5
6
+ metadata.gz: 3840a380510a58f446e7ab472edab7ed66e068f1c89d7d3b9384163b56911a6704d0e877b9e193bc9ef561b257a2ec2e73c25ed6fed6083bbe108b30f905adfb
7
+ data.tar.gz: 23edee3f853f30bf832521e6208313e7aa2888e8ec786299ff80b890b1e89a0d3d25d749f5f9b21b94a3c4e2253fda0282a008688cff8e5c1b290e4cb8ce6d57
data/README.adoc CHANGED
@@ -57,7 +57,7 @@ item = hit_collection[0].fetch
57
57
  [source,ruby]
58
58
  ----
59
59
  item.to_xml
60
- => "<bibitem id="XEP0001" type="standard" schema-version="v1.2.3">
60
+ => "<bibitem id="XEP0001" type="standard" schema-version="v1.2.4">
61
61
  <fetched>2023-07-18</fetched>
62
62
  <title format="text/plain" language="en" script="Latn">XMPP Extension Protocols</title>
63
63
  ...
@@ -67,7 +67,7 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
67
67
  [source,ruby]
68
68
  ----
69
69
  item.to_xml bibdata: true
70
- => "<bibdata type="standard" schema-version="v1.2.3">
70
+ => "<bibdata type="standard" schema-version="v1.2.4">
71
71
  <fetched>2023-07-18</fetched>
72
72
  <title format="text/plain" language="en" script="Latn">XMPP Extension Protocols</title>
73
73
  ...
@@ -7,15 +7,15 @@ module RelatonXsf
7
7
  end
8
8
 
9
9
  def get(code, _year = nil, _opts = {})
10
- warn "[relaton-xsf] (#{code}) fetching..."
10
+ Util.warn "(#{code}) fetching..."
11
11
  result = search(code)
12
12
  if result.empty?
13
- warn "[relaton-xsf] (#{code}) nothing found"
13
+ Util.warn "(#{code}) nothing found"
14
14
  return
15
15
  end
16
16
 
17
17
  bib = result.first.fetch
18
- warn "[relaton-xsf] (#{code}) found #{bib.docidentifier.first.id}"
18
+ Util.warn "(#{code}) found `#{bib.docidentifier.first.id}`"
19
19
  bib
20
20
  end
21
21
  end
@@ -0,0 +1,10 @@
1
+ module RelatonXsf
2
+ module Config
3
+ include RelatonBib::Config
4
+ end
5
+ extend Config
6
+
7
+ class Configuration < RelatonBib::Configuration
8
+ PROGNAME = "relaton-xsf".freeze
9
+ end
10
+ end
@@ -10,14 +10,14 @@ module RelatonXsf
10
10
  end
11
11
 
12
12
  def self.fetch(output: "data", format: "yaml")
13
- warn "[relaton-xsf] fetching data to #{output} in #{format} format"
13
+ warn "fetching data to #{output} in #{format} format"
14
14
  t1 = Time.now
15
- warn "[relaton-xsf] start at #{t1}"
15
+ warn "start at #{t1}"
16
16
  FileUtils.mkdir_p output
17
17
  new(output, format).fetch
18
18
  t2 = Time.now
19
19
  t = t2 - t1
20
- warn "[relaton-xsf] finished at #{t2} (#{t.round} seconds)"
20
+ warn "finished at #{t2} (#{t.round} seconds)"
21
21
  end
22
22
 
23
23
  def index
@@ -39,7 +39,7 @@ module RelatonXsf
39
39
  id = bib.docidentifier.find(&:primary).id
40
40
  file = File.join @output, "#{id.gsub(' ', '-').downcase}.#{@ext}"
41
41
  if @files.include? file
42
- warn "[relaton-xsf] WARNING: #{file} already exists"
42
+ warn "WARNING: #{file} already exists"
43
43
  end
44
44
  File.write file, serialize(bib), encoding: "UTF-8"
45
45
  @files << file
@@ -0,0 +1,9 @@
1
+ module RelatonXsf
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonXsf.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonXsf
4
- VERSION = "1.14.0"
4
+ VERSION = "1.16.1"
5
5
  end
data/lib/relaton_xsf.rb CHANGED
@@ -4,6 +4,8 @@ require "mechanize"
4
4
  require "relaton/index"
5
5
  require "relaton_bib"
6
6
  require_relative "relaton_xsf/version"
7
+ require_relative "relaton_xsf/config"
8
+ require_relative "relaton_xsf/util"
7
9
  require_relative "relaton_xsf/bibliographic_item"
8
10
  require_relative "relaton_xsf/bibliography"
9
11
  require_relative "relaton_xsf/hit_collection"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-xsf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.0
4
+ version: 1.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-19 00:00:00.000000000 Z
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.14.0
33
+ version: 1.16.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.14.0
40
+ version: 1.16.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: relaton-index
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -70,11 +70,13 @@ files:
70
70
  - lib/relaton_xsf/bibliographic_item.rb
71
71
  - lib/relaton_xsf/bibliography.rb
72
72
  - lib/relaton_xsf/bibxml_parser.rb
73
+ - lib/relaton_xsf/config.rb
73
74
  - lib/relaton_xsf/data_fetcher.rb
74
75
  - lib/relaton_xsf/hash_converter.rb
75
76
  - lib/relaton_xsf/hit.rb
76
77
  - lib/relaton_xsf/hit_collection.rb
77
78
  - lib/relaton_xsf/processor.rb
79
+ - lib/relaton_xsf/util.rb
78
80
  - lib/relaton_xsf/version.rb
79
81
  - lib/relaton_xsf/xml_parser.rb
80
82
  - sig/relaton_xsf.rbs