relaton-ogc 1.16.2 → 1.16.3

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: fa6ff540d50e236a8e1aae32805840c0e24a4d17b7b1038b2357472ea74ff65a
4
- data.tar.gz: ee011e12cc9aab1b0e0928e13d46627a4b0772cb34e107a401c8d06c3445e27e
3
+ metadata.gz: 94c067f788bc30304bea9b3889f0eeff0e6e87fc5889b4ed0cd0eadf9cf8a832
4
+ data.tar.gz: 72f53392fb689985074830f951af82c2860e3d8ef8e69f7392c15ea360628cd9
5
5
  SHA512:
6
- metadata.gz: cc2f32138c399f241989b6288ca4682d55067d14e05ddb7a236119976e4ec725ac5f5362a431364c1704aab503a27112b5665592d3aa67563615380d06acfee1
7
- data.tar.gz: 6db6033ad4d01acaedf66fe1bf6ae8fe7ab23127bd690e86e38849897b05961e0c5669a04921db398336d29b3cec1df4cc30ed307905bb944e28776eea32e916
6
+ metadata.gz: 6809fb1fc685773538971a94fe6f232c7468ef2c6474c3889b6f9107b917c9f0d3e9eeca87dfc15971ba1c60954e44a3572424416e514133e2430d9ed49e13c8
7
+ data.tar.gz: 03d0cb7c9325f5ef1d12baf1dd64b23012d1202ca7a20ff257d94a6411cd130f42423fe3125d4f92371adcdffbe1f6113e5c2c1f677389575c7b4c6fdb23d961
data/README.adoc CHANGED
@@ -31,13 +31,24 @@ Or install it yourself as:
31
31
 
32
32
  == Usage
33
33
 
34
- === Search for a standard using keywords
34
+ === Configuration
35
+
36
+ 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 `RelatonOgc.configure` block.
35
37
 
36
38
  [source,ruby]
37
39
  ----
38
40
  require 'relaton_ogc'
39
41
  => true
40
42
 
43
+ RelatonOgc.configure do |config|
44
+ config.logger.level = Logger::DEBUG
45
+ end
46
+ ----
47
+
48
+ === Search for a standard using keywords
49
+
50
+ [source,ruby]
51
+ ----
41
52
  hits = RelatonOgc::OgcBibliography.search("OGC 19-025r1")
42
53
  => <RelatonOgc::HitCollection:0x007fcc8e085ba8 @ref=OGC 19-025r1 @fetched=true>
43
54
 
@@ -83,8 +94,8 @@ item.to_xml bibdata: true
83
94
  [source,ruby]
84
95
  ----
85
96
  RelatonOgc::OgcBibliography.get "OGC 19-025r1", "2019", {}
86
- [relaton-ogc] ("OGC 19-025r1") fetching...
87
- [relaton-ogc] ("OGC 19-025r1") found 19-025r1
97
+ [relaton-ogc] (OGC 19-025r1) Fetching from Relaton repository ...
98
+ [relaton-ogc] (OGC 19-025r1) Found: `19-025r1`
88
99
  => #<RelatonOgc::OgcBibliographicItem:0x007fc322e9aba0
89
100
  ...
90
101
  ----
@@ -16,8 +16,7 @@ module RelatonOgc
16
16
 
17
17
  def initialize(**args)
18
18
  if args[:subdoctype] && !SUBTYPES.include?(args[:subdoctype])
19
- warn "[relaton-ogc] WARNING: invalid document "\
20
- "subtype: #{args[:subdoctype]}"
19
+ Util.warn "WARNING: Invalid document subtype: `#{args[:subdoctype]}`"
21
20
  end
22
21
 
23
22
  # @docsubtype = args.delete :docsubtype
@@ -20,10 +20,11 @@ module RelatonOgc
20
20
  #
21
21
  # @return [String] Relaton XML serialisation of reference
22
22
  def get(code, year = nil, opts = {})
23
+ # id = year ? "`#{code}` year `#{year}`" : "#`{code}`"
23
24
  result = bib_search_filter(code, year, opts) || (return nil)
24
25
  ret = bib_results_filter(result, year)
25
26
  if ret[:ret]
26
- Util.warn "(#{code}) found `#{ret[:ret].docidentifier.first.id}`"
27
+ Util.warn "(#{code}) Found: `#{ret[:ret].docidentifier.first.id}`"
27
28
  ret[:ret]
28
29
  else
29
30
  fetch_ref_err(code, year, ret[:years])
@@ -33,7 +34,7 @@ module RelatonOgc
33
34
  private
34
35
 
35
36
  def bib_search_filter(code, year, opts)
36
- Util.warn "(#{code}) fetching..."
37
+ Util.warn "(#{code}) Fetching from Relaton repository ..."
37
38
  search(code, year, opts)
38
39
  end
39
40
 
@@ -67,9 +68,7 @@ module RelatonOgc
67
68
  # @param year [String]
68
69
  # @param missed_years [Array<Strig>]
69
70
  def fetch_ref_err(code, year, missed_years)
70
- id = year ? "`#{code}` year `#{year}`" : "#`{code}`"
71
- Util.warn "WARNING: no match found online for #{id}. " \
72
- "The code must be exactly like it is on the standards website."
71
+ Util.warn "(#{code}) Not found."
73
72
  unless missed_years.empty?
74
73
  Util.warn "There was no match for `#{year}`, though there " \
75
74
  "were matches found for `#{missed_years.join('`, `')}`."
@@ -75,6 +75,7 @@ module RelatonOgc
75
75
  # @param url [String]
76
76
  # @return [Array>RelatonBib::TypedUri>]
77
77
  def fetch_link(url)
78
+ # type = url.end_with?("pdf") ? "pdf" : "src"
78
79
  [RelatonBib::TypedUri.new(type: "obp", content: url)]
79
80
  end
80
81
 
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
2
- VERSION = "1.16.2".freeze
2
+ VERSION = "1.16.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
4
+ version: 1.16.3
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-09-22 00:00:00.000000000 Z
11
+ date: 2023-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday