relaton-xsf 1.18.1 → 1.19.0

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: df87503b8c80969cff84e957d8d4cb37bfb78c5e29e1cc77787259dd882b8ebf
4
- data.tar.gz: 5d2ede2f4e894ee8ad58cbc6277d28245e59e22143bedbaff4e7407e1a4a669d
3
+ metadata.gz: fbdec6f6009810867d7be4cb3bd34bfdf581531f94b0e273ff550866ffceeb8b
4
+ data.tar.gz: 41e7652ccf48683a019527ed77d69f7535cc51f4d72d96b8d07013bf6b64971b
5
5
  SHA512:
6
- metadata.gz: 7d6a784079221ea394217c6d92fc33c1639f4094bf8d2656fc414999b35d56f1bc43d284255488246abe357f9dcc9c067b2fb834c3c38d4ecc5ef2f120696bbf
7
- data.tar.gz: eedc9414f3a7a1e2c9b7b1c69ce9a5484405f6247bca8dc1458ad953d1bf6100f8492705a95f9ce9303b8d9e43a8bd24b41bf828dd1d9abc4f48661c8d834e1d
6
+ metadata.gz: f3aea8710f9b28e58260f69d31e057e0405bfefe6885b17c6d70be27091ddc05d5f5d0dec0c7404a4de77702145aae517486ff59b56bf8433c746ee237dc09e1
7
+ data.tar.gz: c9e602abefc78ed7a79ea1d58eedd7b672391df9e50f4cf655692015305e12cdba0971f28d72d928d2e9b3c7edbd6416b191a071754c69aa67026ce2e6aaf32c
data/README.adoc CHANGED
@@ -38,24 +38,13 @@ Or install it yourself as:
38
38
 
39
39
  == Usage
40
40
 
41
- === Configuration
42
-
43
- Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `RelatonXsf.configure` block.
41
+ === Search for a standard using keywords
44
42
 
45
43
  [source,ruby]
46
44
  ----
47
45
  require 'relaton_xsf'
48
46
  => true
49
47
 
50
- RelatonXsf.configure do |config|
51
- config.logger.level = Logger::DEBUG
52
- end
53
- ----
54
-
55
- === Search for a standard using keywords
56
-
57
- [source,ruby]
58
- ----
59
48
  hit_collection = RelatonXsf::Bibliography.search("XEP 0001")
60
49
  => <RelatonXsf::HitCollection:0x00000000019780 @ref=XEP 0001 @fetched=false>
61
50
 
@@ -68,7 +57,7 @@ item = hit_collection[0].fetch
68
57
  [source,ruby]
69
58
  ----
70
59
  item.to_xml
71
- => "<bibitem id="XEP0001" type="standard" schema-version="v1.2.8">
60
+ => "<bibitem id="XEP0001" type="standard" schema-version="v1.2.9">
72
61
  <fetched>2023-07-18</fetched>
73
62
  <title format="text/plain" language="en" script="Latn">XMPP Extension Protocols</title>
74
63
  ...
@@ -78,7 +67,7 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
78
67
  [source,ruby]
79
68
  ----
80
69
  item.to_xml bibdata: true
81
- => "<bibdata type="standard" schema-version="v1.2.8">
70
+ => "<bibdata type="standard" schema-version="v1.2.9">
82
71
  <fetched>2023-07-18</fetched>
83
72
  <title format="text/plain" language="en" script="Latn">XMPP Extension Protocols</title>
84
73
  ...
@@ -134,6 +123,10 @@ Done in: 42 sec.
134
123
  => nil
135
124
  ----
136
125
 
126
+ === Logging
127
+
128
+ RelatonXsf uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
129
+
137
130
  == Development
138
131
 
139
132
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -7,15 +7,15 @@ module RelatonXsf
7
7
  end
8
8
 
9
9
  def get(code, _year = nil, _opts = {})
10
- Util.warn "(#{code}) Fetching from Relaton repository ..."
10
+ Util.info "Fetching from Relaton repository ...", key: code
11
11
  result = search(code)
12
12
  if result.empty?
13
- Util.warn "(#{code}) Not found."
13
+ Util.info "Not found.", key: code
14
14
  return
15
15
  end
16
16
 
17
17
  bib = result.first.fetch
18
- Util.warn "(#{code}) Found: `#{bib.docidentifier.first.id}`"
18
+ Util.info "Found: `#{bib.docidentifier.first.id}`", key: code
19
19
  bib
20
20
  end
21
21
  end
@@ -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 "WARNING: #{file} already exists"
42
+ Util.warn "#{file} already exists"
43
43
  end
44
44
  File.write file, serialize(bib), encoding: "UTF-8"
45
45
  @files << file
@@ -1,9 +1,6 @@
1
1
  module RelatonXsf
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonXsf.configuration.logger
7
- end
4
+ PROGNAME = "relaton-xsf".freeze
8
5
  end
9
6
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonXsf
4
- VERSION = "1.18.1"
4
+ VERSION = "1.19.0"
5
5
  end
data/lib/relaton_xsf.rb CHANGED
@@ -4,7 +4,6 @@ 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
7
  require_relative "relaton_xsf/util"
9
8
  require_relative "relaton_xsf/bibliographic_item"
10
9
  require_relative "relaton_xsf/bibliography"
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.18.1
4
+ version: 1.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-19 00:00:00.000000000 Z
11
+ date: 2024-07-04 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.18.0
33
+ version: 1.19.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.18.0
40
+ version: 1.19.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: relaton-index
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -70,7 +70,6 @@ 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
74
73
  - lib/relaton_xsf/data_fetcher.rb
75
74
  - lib/relaton_xsf/hash_converter.rb
76
75
  - lib/relaton_xsf/hit.rb
@@ -1,10 +0,0 @@
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