ietf-data-importer 0.3.0 → 0.3.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.
@@ -1,92 +1,82 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "yaml"
4
- require_relative "importer/version"
5
- require_relative "importer/group_collection"
6
- require_relative "importer/scrapers"
7
- require_relative "importer/cli"
8
4
 
9
5
  module Ietf
10
6
  module Data
11
- # Main module for IETF/IRTF group data importer
12
7
  module Importer
13
- class Error < StandardError; end
8
+ autoload :VERSION, "#{__dir__}/importer/version"
9
+ autoload :Group, "#{__dir__}/importer/group"
10
+ autoload :GroupCollection, "#{__dir__}/importer/group_collection"
11
+ autoload :Cli, "#{__dir__}/importer/cli"
12
+ autoload :Scrapers, "#{__dir__}/importer/scrapers"
14
13
 
15
- # Path to the groups data file
16
- GROUPS_PATH = File.join(File.dirname(__FILE__), "importer", "groups.yaml")
14
+ GROUPS_PATH = File.join(__dir__, "importer", "groups.yaml")
17
15
 
18
- # Load the groups if the file exists, otherwise return empty collection
19
- def self.load_groups
20
- if File.exist?(GROUPS_PATH)
21
- GroupCollection.from_yaml(File.read(GROUPS_PATH))
22
- else
23
- GroupCollection.new(groups: [])
16
+ class << self
17
+ def collection
18
+ @collection ||= GroupCollection.from_file(GROUPS_PATH)
24
19
  end
25
- end
26
20
 
27
- # All available groups
28
- def self.groups
29
- load_groups.groups
30
- end
21
+ def reset!
22
+ @collection = nil
23
+ end
31
24
 
32
- # Check if a group exists by abbreviation
33
- def self.group_exists?(abbreviation)
34
- !find_group(abbreviation).nil?
35
- end
25
+ def load_groups
26
+ collection
27
+ end
36
28
 
37
- # Find a group by its abbreviation (case insensitive)
38
- def self.find_group(abbreviation)
39
- groups.find { |g| g.abbreviation.downcase == abbreviation.to_s.downcase }
40
- end
29
+ def groups
30
+ collection.groups
31
+ end
41
32
 
42
- # Get all IETF groups
43
- def self.ietf_groups
44
- groups.select { |g| g.organization == "ietf" }
45
- end
33
+ def group_exists?(abbreviation)
34
+ collection.exists?(abbreviation)
35
+ end
46
36
 
47
- # Get all IRTF groups
48
- def self.irtf_groups
49
- groups.select { |g| g.organization == "irtf" }
50
- end
37
+ def find_group(abbreviation)
38
+ collection.find_by_abbreviation(abbreviation)
39
+ end
51
40
 
52
- # Get all working groups (IETF)
53
- def self.working_groups
54
- groups.select { |g| g.type == "wg" }
55
- end
41
+ def ietf_groups
42
+ collection.ietf_groups
43
+ end
56
44
 
57
- # Get all research groups (IRTF)
58
- def self.research_groups
59
- groups.select { |g| g.type == "rg" }
60
- end
45
+ def irtf_groups
46
+ collection.irtf_groups
47
+ end
61
48
 
62
- # Get groups by type
63
- def self.groups_by_type(type)
64
- groups.select { |g| g.type.downcase == type.to_s.downcase }
65
- end
49
+ def working_groups
50
+ collection.working_groups
51
+ end
66
52
 
67
- # Get groups by area
68
- def self.groups_by_area(area)
69
- groups.select { |g| g.area&.downcase == area.to_s.downcase }
70
- end
53
+ def research_groups
54
+ collection.research_groups
55
+ end
71
56
 
72
- # Get active groups
73
- def self.active_groups
74
- groups.select { |g| g.status == "active" }
75
- end
57
+ def groups_by_type(type)
58
+ collection.by_type(type)
59
+ end
76
60
 
77
- # Get concluded groups
78
- def self.concluded_groups
79
- groups.select { |g| g.status == "concluded" }
80
- end
61
+ def groups_by_area(area)
62
+ collection.by_area(area)
63
+ end
81
64
 
82
- # Get all available group types
83
- def self.group_types
84
- groups.map(&:type).uniq.sort
85
- end
65
+ def active_groups
66
+ collection.active
67
+ end
68
+
69
+ def concluded_groups
70
+ collection.concluded
71
+ end
86
72
 
87
- # Get all available areas
88
- def self.areas
89
- groups.map(&:area).compact.uniq.sort
73
+ def group_types
74
+ collection.group_types
75
+ end
76
+
77
+ def areas
78
+ collection.areas
79
+ end
90
80
  end
91
81
  end
92
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ietf-data-importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.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: 2025-03-20 00:00:00.000000000 Z
11
+ date: 2026-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '0.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.7'
26
+ version: '0.8'
27
27
  - !ruby/object:Gem::Dependency
28
- name: thor
28
+ name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '1.19'
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.0'
40
+ version: '1.19'
41
41
  - !ruby/object:Gem::Dependency
42
- name: nokogiri
42
+ name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.18'
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.18'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: yaml
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -83,6 +83,8 @@ files:
83
83
  - ".github/workflows/release.yml"
84
84
  - ".gitignore"
85
85
  - ".rubocop.yml"
86
+ - ".rubocop_todo.yml"
87
+ - CLAUDE.md
86
88
  - Gemfile
87
89
  - README.adoc
88
90
  - Rakefile
@@ -103,7 +105,8 @@ files:
103
105
  homepage: https://github.com/metanorma/ietf-data-importer
104
106
  licenses:
105
107
  - BSD-2-Clause
106
- metadata: {}
108
+ metadata:
109
+ rubygems_mfa_required: 'true'
107
110
  post_install_message:
108
111
  rdoc_options: []
109
112
  require_paths: