w3c_api 0.1.4 → 0.1.5

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +16 -1
  3. data/.rubocop_todo.yml +20 -38
  4. data/README.adoc +51 -0
  5. data/Rakefile +3 -3
  6. data/demo/rate_limiting_demo.rb +135 -0
  7. data/demo/test_embed_functionality.rb +31 -30
  8. data/demo/test_improved_embed_functionality.rb +92 -0
  9. data/examples/rate_limiting_stress_test.rb +239 -0
  10. data/exe/w3c_api +1 -1
  11. data/lib/w3c_api/cli.rb +29 -28
  12. data/lib/w3c_api/client.rb +8 -7
  13. data/lib/w3c_api/commands/affiliation.rb +15 -12
  14. data/lib/w3c_api/commands/ecosystem.rb +22 -15
  15. data/lib/w3c_api/commands/group.rb +32 -25
  16. data/lib/w3c_api/commands/output_formatter.rb +1 -1
  17. data/lib/w3c_api/commands/participation.rb +11 -9
  18. data/lib/w3c_api/commands/series.rb +11 -9
  19. data/lib/w3c_api/commands/specification.rb +59 -45
  20. data/lib/w3c_api/commands/specification_version.rb +21 -12
  21. data/lib/w3c_api/commands/translation.rb +7 -6
  22. data/lib/w3c_api/commands/user.rb +36 -24
  23. data/lib/w3c_api/embed.rb +7 -7
  24. data/lib/w3c_api/hal.rb +168 -133
  25. data/lib/w3c_api/models/account.rb +3 -3
  26. data/lib/w3c_api/models/affiliation.rb +8 -7
  27. data/lib/w3c_api/models/affiliation_index.rb +3 -2
  28. data/lib/w3c_api/models/call_for_translation.rb +4 -3
  29. data/lib/w3c_api/models/chair_index.rb +2 -2
  30. data/lib/w3c_api/models/charter.rb +5 -5
  31. data/lib/w3c_api/models/charter_index.rb +3 -2
  32. data/lib/w3c_api/models/connected_account.rb +2 -2
  33. data/lib/w3c_api/models/deliverer_index.rb +3 -2
  34. data/lib/w3c_api/models/ecosystem.rb +8 -6
  35. data/lib/w3c_api/models/ecosystem_index.rb +3 -2
  36. data/lib/w3c_api/models/editor_index.rb +2 -2
  37. data/lib/w3c_api/models/evangelist_index.rb +3 -2
  38. data/lib/w3c_api/models/group.rb +16 -13
  39. data/lib/w3c_api/models/group_index.rb +2 -2
  40. data/lib/w3c_api/models/groups.rb +2 -2
  41. data/lib/w3c_api/models/participant_index.rb +3 -2
  42. data/lib/w3c_api/models/participation.rb +6 -5
  43. data/lib/w3c_api/models/participation_index.rb +3 -2
  44. data/lib/w3c_api/models/photo.rb +1 -1
  45. data/lib/w3c_api/models/serie.rb +6 -4
  46. data/lib/w3c_api/models/serie_index.rb +3 -2
  47. data/lib/w3c_api/models/spec_version.rb +10 -7
  48. data/lib/w3c_api/models/spec_version_index.rb +3 -2
  49. data/lib/w3c_api/models/spec_version_predecessor_index.rb +3 -2
  50. data/lib/w3c_api/models/spec_version_successor_index.rb +3 -2
  51. data/lib/w3c_api/models/specification.rb +17 -9
  52. data/lib/w3c_api/models/specification_index.rb +3 -2
  53. data/lib/w3c_api/models/team_contact_index.rb +3 -2
  54. data/lib/w3c_api/models/testimonial.rb +2 -2
  55. data/lib/w3c_api/models/translation.rb +4 -4
  56. data/lib/w3c_api/models/translation_index.rb +3 -2
  57. data/lib/w3c_api/models/user.rb +16 -11
  58. data/lib/w3c_api/models/user_index.rb +2 -2
  59. data/lib/w3c_api/models.rb +52 -37
  60. data/lib/w3c_api/version.rb +1 -1
  61. data/lib/w3c_api.rb +8 -8
  62. metadata +8 -5
@@ -62,8 +62,8 @@
62
62
  # }
63
63
  # }
64
64
 
65
- require_relative 'account'
66
- require_relative 'photo'
65
+ require_relative "account"
66
+ require_relative "photo"
67
67
 
68
68
  module W3cApi
69
69
  module Models
@@ -79,14 +79,19 @@ module W3cApi
79
79
  attribute :connected_accounts, Account, collection: true
80
80
  attribute :photos, Photo, collection: true
81
81
 
82
- hal_link :self, key: 'self', realize_class: 'User'
83
- hal_link :affiliations, key: 'affiliations', realize_class: 'AffiliationIndex'
84
- hal_link :groups, key: 'groups', realize_class: 'GroupIndex'
85
- hal_link :specifications, key: 'specifications', realize_class: 'SpecificationIndex'
86
- hal_link :participations, key: 'participations', realize_class: 'ParticipationIndex'
87
- hal_link :chair_of_groups, key: 'chair-of-groups', realize_class: 'GroupIndex'
88
- hal_link :team_contact_of_groups, key: 'team-contact-of-groups', realize_class: 'GroupIndex'
89
- hal_link :photos, key: 'photos', realize_class: 'Photo', collection: true
82
+ hal_link :self, key: "self", realize_class: "User"
83
+ hal_link :affiliations, key: "affiliations",
84
+ realize_class: "AffiliationIndex"
85
+ hal_link :groups, key: "groups", realize_class: "GroupIndex"
86
+ hal_link :specifications, key: "specifications",
87
+ realize_class: "SpecificationIndex"
88
+ hal_link :participations, key: "participations",
89
+ realize_class: "ParticipationIndex"
90
+ hal_link :chair_of_groups, key: "chair-of-groups",
91
+ realize_class: "GroupIndex"
92
+ hal_link :team_contact_of_groups, key: "team-contact-of-groups",
93
+ realize_class: "GroupIndex"
94
+ hal_link :photos, key: "photos", realize_class: "Photo", collection: true
90
95
 
91
96
  key_value do
92
97
  %i[
@@ -100,7 +105,7 @@ module W3cApi
100
105
  connected_accounts
101
106
  photos
102
107
  ].each do |key|
103
- map key.to_s.tr('_', '-'), to: key
108
+ map key.to_s.tr("_", "-"), to: key
104
109
  end
105
110
  end
106
111
 
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'user'
3
+ require_relative "user"
4
4
 
5
5
  module W3cApi
6
6
  module Models
7
7
  class UserIndex < Lutaml::Hal::Page
8
- hal_link :users, key: 'users', realize_class: 'User', collection: true
8
+ hal_link :users, key: "users", realize_class: "User", collection: true
9
9
  end
10
10
  end
11
11
  end
@@ -6,42 +6,57 @@ module W3cApi
6
6
  # This eliminates the class loading order dependency that caused
7
7
  # inconsistent type names in HAL output
8
8
 
9
- autoload :Account, File.expand_path('models/account', __dir__)
10
- autoload :Affiliation, File.expand_path('models/affiliation', __dir__)
11
- autoload :AffiliationIndex, File.expand_path('models/affiliation_index', __dir__)
12
- autoload :CallForTranslation, File.expand_path('models/call_for_translation', __dir__)
13
- autoload :ChairIndex, File.expand_path('models/chair_index', __dir__)
14
- autoload :Charter, File.expand_path('models/charter', __dir__)
15
- autoload :CharterIndex, File.expand_path('models/charter_index', __dir__)
16
- autoload :ConnectedAccount, File.expand_path('models/connected_account', __dir__)
17
- autoload :DelivererIndex, File.expand_path('models/deliverer_index', __dir__)
18
- autoload :Ecosystem, File.expand_path('models/ecosystem', __dir__)
19
- autoload :EcosystemIndex, File.expand_path('models/ecosystem_index', __dir__)
20
- autoload :EditorIndex, File.expand_path('models/editor_index', __dir__)
21
- autoload :EvangelistIndex, File.expand_path('models/evangelist_index', __dir__)
22
- autoload :Extension, File.expand_path('models/extension', __dir__)
23
- autoload :Group, File.expand_path('models/group', __dir__)
24
- autoload :GroupIndex, File.expand_path('models/group_index', __dir__)
25
- autoload :Groups, File.expand_path('models/groups', __dir__)
26
- autoload :JoinEmailIndex, File.expand_path('models/join_emails', __dir__)
27
- autoload :ParticipantIndex, File.expand_path('models/participant_index', __dir__)
28
- autoload :Participation, File.expand_path('models/participation', __dir__)
29
- autoload :ParticipationIndex, File.expand_path('models/participation_index', __dir__)
30
- autoload :Photo, File.expand_path('models/photo', __dir__)
31
- autoload :Serie, File.expand_path('models/serie', __dir__)
32
- autoload :SerieIndex, File.expand_path('models/serie_index', __dir__)
33
- autoload :SpecVersion, File.expand_path('models/spec_version', __dir__)
34
- autoload :SpecVersionIndex, File.expand_path('models/spec_version_index', __dir__)
35
- autoload :SpecVersionPredecessorIndex, File.expand_path('models/spec_version_predecessor_index', __dir__)
36
- autoload :SpecVersionSuccessorIndex, File.expand_path('models/spec_version_successor_index', __dir__)
37
- autoload :SpecVersionRef, File.expand_path('models/spec_version_ref', __dir__)
38
- autoload :Specification, File.expand_path('models/specification', __dir__)
39
- autoload :SpecificationIndex, File.expand_path('models/specification_index', __dir__)
40
- autoload :TeamContactIndex, File.expand_path('models/team_contact_index', __dir__)
41
- autoload :Testimonial, File.expand_path('models/testimonial', __dir__)
42
- autoload :Translation, File.expand_path('models/translation', __dir__)
43
- autoload :TranslationIndex, File.expand_path('models/translation_index', __dir__)
44
- autoload :User, File.expand_path('models/user', __dir__)
45
- autoload :UserIndex, File.expand_path('models/user_index', __dir__)
9
+ autoload :Account, File.expand_path("models/account", __dir__)
10
+ autoload :Affiliation, File.expand_path("models/affiliation", __dir__)
11
+ autoload :AffiliationIndex,
12
+ File.expand_path("models/affiliation_index", __dir__)
13
+ autoload :CallForTranslation,
14
+ File.expand_path("models/call_for_translation", __dir__)
15
+ autoload :ChairIndex, File.expand_path("models/chair_index", __dir__)
16
+ autoload :Charter, File.expand_path("models/charter", __dir__)
17
+ autoload :CharterIndex, File.expand_path("models/charter_index", __dir__)
18
+ autoload :ConnectedAccount,
19
+ File.expand_path("models/connected_account", __dir__)
20
+ autoload :DelivererIndex,
21
+ File.expand_path("models/deliverer_index", __dir__)
22
+ autoload :Ecosystem, File.expand_path("models/ecosystem", __dir__)
23
+ autoload :EcosystemIndex,
24
+ File.expand_path("models/ecosystem_index", __dir__)
25
+ autoload :EditorIndex, File.expand_path("models/editor_index", __dir__)
26
+ autoload :EvangelistIndex,
27
+ File.expand_path("models/evangelist_index", __dir__)
28
+ autoload :Extension, File.expand_path("models/extension", __dir__)
29
+ autoload :Group, File.expand_path("models/group", __dir__)
30
+ autoload :GroupIndex, File.expand_path("models/group_index", __dir__)
31
+ autoload :Groups, File.expand_path("models/groups", __dir__)
32
+ autoload :JoinEmailIndex, File.expand_path("models/join_emails", __dir__)
33
+ autoload :ParticipantIndex,
34
+ File.expand_path("models/participant_index", __dir__)
35
+ autoload :Participation, File.expand_path("models/participation", __dir__)
36
+ autoload :ParticipationIndex,
37
+ File.expand_path("models/participation_index", __dir__)
38
+ autoload :Photo, File.expand_path("models/photo", __dir__)
39
+ autoload :Serie, File.expand_path("models/serie", __dir__)
40
+ autoload :SerieIndex, File.expand_path("models/serie_index", __dir__)
41
+ autoload :SpecVersion, File.expand_path("models/spec_version", __dir__)
42
+ autoload :SpecVersionIndex,
43
+ File.expand_path("models/spec_version_index", __dir__)
44
+ autoload :SpecVersionPredecessorIndex,
45
+ File.expand_path("models/spec_version_predecessor_index", __dir__)
46
+ autoload :SpecVersionSuccessorIndex,
47
+ File.expand_path("models/spec_version_successor_index", __dir__)
48
+ autoload :SpecVersionRef,
49
+ File.expand_path("models/spec_version_ref", __dir__)
50
+ autoload :Specification, File.expand_path("models/specification", __dir__)
51
+ autoload :SpecificationIndex,
52
+ File.expand_path("models/specification_index", __dir__)
53
+ autoload :TeamContactIndex,
54
+ File.expand_path("models/team_contact_index", __dir__)
55
+ autoload :Testimonial, File.expand_path("models/testimonial", __dir__)
56
+ autoload :Translation, File.expand_path("models/translation", __dir__)
57
+ autoload :TranslationIndex,
58
+ File.expand_path("models/translation_index", __dir__)
59
+ autoload :User, File.expand_path("models/user", __dir__)
60
+ autoload :UserIndex, File.expand_path("models/user_index", __dir__)
46
61
  end
47
62
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module W3cApi
4
- VERSION = '0.1.4'
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/w3c_api.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
- require 'lutaml/hal'
3
+ require "lutaml/model"
4
+ require "lutaml/hal"
5
5
 
6
- require_relative 'w3c_api/version'
7
- require_relative 'w3c_api/hal'
8
- require_relative 'w3c_api/models'
9
- require_relative 'w3c_api/client'
10
- require_relative 'w3c_api/embed'
11
- require_relative 'w3c_api/cli'
6
+ require_relative "w3c_api/version"
7
+ require_relative "w3c_api/hal"
8
+ require_relative "w3c_api/models"
9
+ require_relative "w3c_api/client"
10
+ require_relative "w3c_api/embed"
11
+ require_relative "w3c_api/cli"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: w3c_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
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-07-08 00:00:00.000000000 Z
11
+ date: 2025-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.9
47
+ version: 0.1.10
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: 0.1.9
54
+ version: 0.1.10
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rainbow
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -93,7 +93,10 @@ files:
93
93
  - LICENSE.md
94
94
  - README.adoc
95
95
  - Rakefile
96
+ - demo/rate_limiting_demo.rb
96
97
  - demo/test_embed_functionality.rb
98
+ - demo/test_improved_embed_functionality.rb
99
+ - examples/rate_limiting_stress_test.rb
97
100
  - exe/w3c_api
98
101
  - lib/w3c_api.rb
99
102
  - lib/w3c_api/cli.rb
@@ -164,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
167
  requirements:
165
168
  - - ">="
166
169
  - !ruby/object:Gem::Version
167
- version: 2.7.0
170
+ version: 3.1.0
168
171
  required_rubygems_version: !ruby/object:Gem::Requirement
169
172
  requirements:
170
173
  - - ">="