relaton-ogc 1.13.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.github/workflows/rake.yml +0 -1
 - data/.github/workflows/release.yml +22 -0
 - data/README.adoc +15 -19
 - data/grammars/basicdoc.rng +3 -27
 - data/grammars/biblio-standoc.rng +164 -0
 - data/grammars/biblio.rng +82 -19
 - data/grammars/relaton-ogc-compile.rng +11 -0
 - data/grammars/{ogc.rng → relaton-ogc.rng} +18 -86
 - data/lib/relaton_ogc/hit_collection.rb +3 -1
 - data/lib/relaton_ogc/ogc_bibliographic_item.rb +12 -2
 - data/lib/relaton_ogc/ogc_bibliography.rb +4 -4
 - data/lib/relaton_ogc/scrapper.rb +0 -1
 - data/lib/relaton_ogc/version.rb +1 -1
 - data/relaton_ogc.gemspec +1 -1
 - metadata +12 -11
 - data/grammars/isodoc.rng +0 -2807
 - data/grammars/reqt.rng +0 -223
 
| 
         @@ -31,7 +31,9 @@ module RelatonOgc 
     | 
|
| 
       31 
31 
     | 
    
         
             
                  end
         
     | 
| 
       32 
32 
     | 
    
         
             
                  @array = case resp.status
         
     | 
| 
       33 
33 
     | 
    
         
             
                           when 200
         
     | 
| 
       34 
     | 
    
         
            -
                              
     | 
| 
      
 34 
     | 
    
         
            +
                             hash = YAML.safe_load(resp.body)
         
     | 
| 
      
 35 
     | 
    
         
            +
                             hash["fetched"] = Date.today.to_s
         
     | 
| 
      
 36 
     | 
    
         
            +
                             bib = OgcBibliographicItem.from_hash hash
         
     | 
| 
       35 
37 
     | 
    
         
             
                             [Hit.new(bib, self)]
         
     | 
| 
       36 
38 
     | 
    
         
             
                           else []
         
     | 
| 
       37 
39 
     | 
    
         
             
                           end
         
     | 
| 
         @@ -25,6 +25,15 @@ module RelatonOgc 
     | 
|
| 
       25 
25 
     | 
    
         
             
                  super
         
     | 
| 
       26 
26 
     | 
    
         
             
                end
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
      
 28 
     | 
    
         
            +
                #
         
     | 
| 
      
 29 
     | 
    
         
            +
                # Fetches flavof schema version
         
     | 
| 
      
 30 
     | 
    
         
            +
                #
         
     | 
| 
      
 31 
     | 
    
         
            +
                # @return [String] schema version
         
     | 
| 
      
 32 
     | 
    
         
            +
                #
         
     | 
| 
      
 33 
     | 
    
         
            +
                def ext_schema
         
     | 
| 
      
 34 
     | 
    
         
            +
                  @ext_schema ||= schema_versions["relaton-model-ogc"]
         
     | 
| 
      
 35 
     | 
    
         
            +
                end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
       28 
37 
     | 
    
         
             
                # @param hash [Hash]
         
     | 
| 
       29 
38 
     | 
    
         
             
                # @return [RelatonOgc::OgcBibliographicItem]
         
     | 
| 
       30 
39 
     | 
    
         
             
                def self.from_hash(hash)
         
     | 
| 
         @@ -45,14 +54,15 @@ module RelatonOgc 
     | 
|
| 
       45 
54 
     | 
    
         
             
                # @option opts [Symbol, NilClass] :date_format (:short), :full
         
     | 
| 
       46 
55 
     | 
    
         
             
                # @option opts [String, Symbol] :lang language
         
     | 
| 
       47 
56 
     | 
    
         
             
                # @return [String] XML
         
     | 
| 
       48 
     | 
    
         
            -
                def to_xml(**opts)
         
     | 
| 
      
 57 
     | 
    
         
            +
                def to_xml(**opts) # rubocop:disable Metrics/AbcSize
         
     | 
| 
       49 
58 
     | 
    
         
             
                  super(**opts) do |b|
         
     | 
| 
       50 
     | 
    
         
            -
                    b.ext do
         
     | 
| 
      
 59 
     | 
    
         
            +
                    ext = b.ext do
         
     | 
| 
       51 
60 
     | 
    
         
             
                      b.doctype doctype if doctype
         
     | 
| 
       52 
61 
     | 
    
         
             
                      b.subdoctype subdoctype if subdoctype
         
     | 
| 
       53 
62 
     | 
    
         
             
                      editorialgroup&.to_xml b
         
     | 
| 
       54 
63 
     | 
    
         
             
                      ics.each { |i| i.to_xml b }
         
     | 
| 
       55 
64 
     | 
    
         
             
                    end
         
     | 
| 
      
 65 
     | 
    
         
            +
                    ext["schema-version"] = ext_schema unless opts[:embedded]
         
     | 
| 
       56 
66 
     | 
    
         
             
                  end
         
     | 
| 
       57 
67 
     | 
    
         
             
                end
         
     | 
| 
       58 
68 
     | 
    
         | 
| 
         @@ -68,11 +68,11 @@ module RelatonOgc 
     | 
|
| 
       68 
68 
     | 
    
         
             
                  # @param missed_years [Array<Strig>]
         
     | 
| 
       69 
69 
     | 
    
         
             
                  def fetch_ref_err(code, year, missed_years)
         
     | 
| 
       70 
70 
     | 
    
         
             
                    id = year ? "#{code} year #{year}" : code
         
     | 
| 
       71 
     | 
    
         
            -
                    warn "[relaton-ogc] WARNING: no match found online for #{id}. "\
         
     | 
| 
       72 
     | 
    
         
            -
             
     | 
| 
      
 71 
     | 
    
         
            +
                    warn "[relaton-ogc] WARNING: no match found online for #{id}. " \
         
     | 
| 
      
 72 
     | 
    
         
            +
                         "The code must be exactly like it is on the standards website."
         
     | 
| 
       73 
73 
     | 
    
         
             
                    unless missed_years.empty?
         
     | 
| 
       74 
     | 
    
         
            -
                      warn "[relaton-ogc] (There was no match for #{year}, though there  
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
      
 74 
     | 
    
         
            +
                      warn "[relaton-ogc] (There was no match for #{year}, though there " \
         
     | 
| 
      
 75 
     | 
    
         
            +
                           "were matches found for #{missed_years.join(', ')}.)"
         
     | 
| 
       76 
76 
     | 
    
         
             
                    end
         
     | 
| 
       77 
77 
     | 
    
         
             
                    nil
         
     | 
| 
       78 
78 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/relaton_ogc/scrapper.rb
    CHANGED
    
    | 
         @@ -37,7 +37,6 @@ module RelatonOgc 
     | 
|
| 
       37 
37 
     | 
    
         
             
                  def parse_page(hit) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
         
     | 
| 
       38 
38 
     | 
    
         
             
                    type = fetch_type(hit["type"])
         
     | 
| 
       39 
39 
     | 
    
         
             
                    OgcBibliographicItem.new(
         
     | 
| 
       40 
     | 
    
         
            -
                      fetched: Date.today.to_s,
         
     | 
| 
       41 
40 
     | 
    
         
             
                      type: "standard",
         
     | 
| 
       42 
41 
     | 
    
         
             
                      title: fetch_title(hit["title"]),
         
     | 
| 
       43 
42 
     | 
    
         
             
                      docid: fetch_docid(hit["identifier"]),
         
     | 
    
        data/lib/relaton_ogc/version.rb
    CHANGED
    
    
    
        data/relaton_ogc.gemspec
    CHANGED
    
    
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.14.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ribose Inc.
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire:
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2022- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-12-06 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: equivalent-xml
         
     | 
| 
         @@ -142,14 +142,14 @@ dependencies: 
     | 
|
| 
       142 
142 
     | 
    
         
             
                requirements:
         
     | 
| 
       143 
143 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       144 
144 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       145 
     | 
    
         
            -
                    version: 1. 
     | 
| 
      
 145 
     | 
    
         
            +
                    version: 1.14.0
         
     | 
| 
       146 
146 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       147 
147 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       148 
148 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       149 
149 
     | 
    
         
             
                requirements:
         
     | 
| 
       150 
150 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       151 
151 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       152 
     | 
    
         
            -
                    version: 1. 
     | 
| 
      
 152 
     | 
    
         
            +
                    version: 1.14.0
         
     | 
| 
       153 
153 
     | 
    
         
             
            description: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
         
     | 
| 
       154 
154 
     | 
    
         
             
              model'
         
     | 
| 
       155 
155 
     | 
    
         
             
            email:
         
     | 
| 
         @@ -159,6 +159,7 @@ extensions: [] 
     | 
|
| 
       159 
159 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       160 
160 
     | 
    
         
             
            files:
         
     | 
| 
       161 
161 
     | 
    
         
             
            - ".github/workflows/rake.yml"
         
     | 
| 
      
 162 
     | 
    
         
            +
            - ".github/workflows/release.yml"
         
     | 
| 
       162 
163 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
       163 
164 
     | 
    
         
             
            - ".rspec"
         
     | 
| 
       164 
165 
     | 
    
         
             
            - ".rubocop.yml"
         
     | 
| 
         @@ -170,10 +171,10 @@ files: 
     | 
|
| 
       170 
171 
     | 
    
         
             
            - bin/rspec
         
     | 
| 
       171 
172 
     | 
    
         
             
            - bin/setup
         
     | 
| 
       172 
173 
     | 
    
         
             
            - grammars/basicdoc.rng
         
     | 
| 
      
 174 
     | 
    
         
            +
            - grammars/biblio-standoc.rng
         
     | 
| 
       173 
175 
     | 
    
         
             
            - grammars/biblio.rng
         
     | 
| 
       174 
     | 
    
         
            -
            - grammars/ 
     | 
| 
       175 
     | 
    
         
            -
            - grammars/ogc.rng
         
     | 
| 
       176 
     | 
    
         
            -
            - grammars/reqt.rng
         
     | 
| 
      
 176 
     | 
    
         
            +
            - grammars/relaton-ogc-compile.rng
         
     | 
| 
      
 177 
     | 
    
         
            +
            - grammars/relaton-ogc.rng
         
     | 
| 
       177 
178 
     | 
    
         
             
            - lib/relaton_ogc.rb
         
     | 
| 
       178 
179 
     | 
    
         
             
            - lib/relaton_ogc/data_fetcher.rb
         
     | 
| 
       179 
180 
     | 
    
         
             
            - lib/relaton_ogc/editorial_group.rb
         
     | 
| 
         @@ -191,7 +192,7 @@ homepage: https://github.com/relaton/relaton-ogc 
     | 
|
| 
       191 
192 
     | 
    
         
             
            licenses:
         
     | 
| 
       192 
193 
     | 
    
         
             
            - BSD-2-Clause
         
     | 
| 
       193 
194 
     | 
    
         
             
            metadata: {}
         
     | 
| 
       194 
     | 
    
         
            -
            post_install_message:
         
     | 
| 
      
 195 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
       195 
196 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       196 
197 
     | 
    
         
             
            require_paths:
         
     | 
| 
       197 
198 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -206,8 +207,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       206 
207 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       207 
208 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       208 
209 
     | 
    
         
             
            requirements: []
         
     | 
| 
       209 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
       210 
     | 
    
         
            -
            signing_key:
         
     | 
| 
      
 210 
     | 
    
         
            +
            rubygems_version: 3.1.6
         
     | 
| 
      
 211 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
       211 
212 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       212 
213 
     | 
    
         
             
            summary: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
         
     | 
| 
       213 
214 
     | 
    
         
             
              model'
         
     |