w3c_api 0.1.3 → 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 +23 -32
  4. data/README.adoc +297 -827
  5. data/Rakefile +3 -3
  6. data/demo/rate_limiting_demo.rb +135 -0
  7. data/demo/test_embed_functionality.rb +88 -0
  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 +30 -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 +40 -0
  24. data/lib/w3c_api/hal.rb +374 -164
  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 -7
  62. metadata +10 -19
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/hal'
3
+ require "lutaml/hal"
4
4
 
5
5
  # "testimonials": {
6
6
  # "en": "Google's mission is to organize the world’s information and make it universally accessible and useful."
@@ -12,7 +12,7 @@ module W3cApi
12
12
  attribute :en, :string
13
13
 
14
14
  key_value do
15
- map 'en', to: :en
15
+ map "en", to: :en
16
16
  end
17
17
  end
18
18
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'call_for_translation'
4
- require_relative 'user'
3
+ require_relative "call_for_translation"
4
+ require_relative "user"
5
5
 
6
6
  # {
7
7
  # "states"=>[
@@ -98,7 +98,7 @@ module W3cApi
98
98
  attribute :states, :string, collection: true
99
99
  attribute :translators, User, collection: true
100
100
 
101
- hal_link :self, key: 'self', realize_class: 'Translation'
101
+ hal_link :self, key: "self", realize_class: "Translation"
102
102
 
103
103
  key_value do
104
104
  %i[
@@ -115,7 +115,7 @@ module W3cApi
115
115
  states
116
116
  translators
117
117
  ].each do |key|
118
- map key.to_s.tr('_', '-'), to: key
118
+ map key.to_s.tr("_", "-"), to: key
119
119
  end
120
120
  end
121
121
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'translation'
3
+ require_relative "translation"
4
4
 
5
5
  # {
6
6
  # "page"=>1,
@@ -28,7 +28,8 @@ require_relative 'translation'
28
28
  module W3cApi
29
29
  module Models
30
30
  class TranslationIndex < Lutaml::Hal::Page
31
- hal_link :translations, key: 'translations', realize_class: 'Translation', collection: true
31
+ hal_link :translations, key: "translations",
32
+ realize_class: "Translation", collection: true
32
33
  end
33
34
  end
34
35
  end
@@ -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, 'w3c_api/models/account'
10
- autoload :Affiliation, 'w3c_api/models/affiliation'
11
- autoload :AffiliationIndex, 'w3c_api/models/affiliation_index'
12
- autoload :CallForTranslation, 'w3c_api/models/call_for_translation'
13
- autoload :ChairIndex, 'w3c_api/models/chair_index'
14
- autoload :Charter, 'w3c_api/models/charter'
15
- autoload :CharterIndex, 'w3c_api/models/charter_index'
16
- autoload :ConnectedAccount, 'w3c_api/models/connected_account'
17
- autoload :DelivererIndex, 'w3c_api/models/deliverer_index'
18
- autoload :Ecosystem, 'w3c_api/models/ecosystem'
19
- autoload :EcosystemIndex, 'w3c_api/models/ecosystem_index'
20
- autoload :EditorIndex, 'w3c_api/models/editor_index'
21
- autoload :EvangelistIndex, 'w3c_api/models/evangelist_index'
22
- autoload :Extension, 'w3c_api/models/extension'
23
- autoload :Group, 'w3c_api/models/group'
24
- autoload :GroupIndex, 'w3c_api/models/group_index'
25
- autoload :Groups, 'w3c_api/models/groups'
26
- autoload :JoinEmails, 'w3c_api/models/join_emails'
27
- autoload :ParticipantIndex, 'w3c_api/models/participant_index'
28
- autoload :Participation, 'w3c_api/models/participation'
29
- autoload :ParticipationIndex, 'w3c_api/models/participation_index'
30
- autoload :Photo, 'w3c_api/models/photo'
31
- autoload :Serie, 'w3c_api/models/serie'
32
- autoload :SerieIndex, 'w3c_api/models/serie_index'
33
- autoload :SpecVersion, 'w3c_api/models/spec_version'
34
- autoload :SpecVersionIndex, 'w3c_api/models/spec_version_index'
35
- autoload :SpecVersionPredecessorIndex, 'w3c_api/models/spec_version_predecessor_index'
36
- autoload :SpecVersionSuccessorIndex, 'w3c_api/models/spec_version_successor_index'
37
- autoload :SpecVersionRef, 'w3c_api/models/spec_version_ref'
38
- autoload :Specification, 'w3c_api/models/specification'
39
- autoload :SpecificationIndex, 'w3c_api/models/specification_index'
40
- autoload :TeamContactIndex, 'w3c_api/models/team_contact_index'
41
- autoload :Testimonial, 'w3c_api/models/testimonial'
42
- autoload :Translation, 'w3c_api/models/translation'
43
- autoload :TranslationIndex, 'w3c_api/models/translation_index'
44
- autoload :User, 'w3c_api/models/user'
45
- autoload :UserIndex, 'w3c_api/models/user_index'
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.3'
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/w3c_api.rb CHANGED
@@ -1,10 +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/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.3
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-05 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,28 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.7
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.7
55
- - !ruby/object:Gem::Dependency
56
- name: lutaml-model
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
54
+ version: 0.1.10
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rainbow
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +93,10 @@ files:
107
93
  - LICENSE.md
108
94
  - README.adoc
109
95
  - Rakefile
96
+ - demo/rate_limiting_demo.rb
97
+ - demo/test_embed_functionality.rb
98
+ - demo/test_improved_embed_functionality.rb
99
+ - examples/rate_limiting_stress_test.rb
110
100
  - exe/w3c_api
111
101
  - lib/w3c_api.rb
112
102
  - lib/w3c_api/cli.rb
@@ -121,6 +111,7 @@ files:
121
111
  - lib/w3c_api/commands/specification_version.rb
122
112
  - lib/w3c_api/commands/translation.rb
123
113
  - lib/w3c_api/commands/user.rb
114
+ - lib/w3c_api/embed.rb
124
115
  - lib/w3c_api/hal.rb
125
116
  - lib/w3c_api/models.rb
126
117
  - lib/w3c_api/models/account.rb
@@ -176,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
167
  requirements:
177
168
  - - ">="
178
169
  - !ruby/object:Gem::Version
179
- version: 2.7.0
170
+ version: 3.1.0
180
171
  required_rubygems_version: !ruby/object:Gem::Requirement
181
172
  requirements:
182
173
  - - ">="