foobara-ruby-gems-api 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2bbc224b6e89aa27f672b5dd09763ba05a25e4cf5aa15bd9f9397af3701e3c7
4
- data.tar.gz: e5673c03e85a85a23f8dac77b83eee716dc52bd43bf701a631bd39f9d11012c0
3
+ metadata.gz: 77f104d162c3782a13a4cf777f68c6628695bc71d9b80b719b05599012d40412
4
+ data.tar.gz: 5ff81b6947cbf488ac7186e83a3734bc73470bb717e02875479e413253efb39a
5
5
  SHA512:
6
- metadata.gz: 61ea1b99406a72586256536df731eb8d67e9c698437b7562e9239981662f9835f924a0fd627671c99b7769a3d56a7b62a8b5921a2420bc13b9de4077ad7971a7
7
- data.tar.gz: 3e1f22c6682f19c1d41f84ee77e208d5b1299d0af3a181ba0749c586c15c45faf53b5d36a837f66a9a624c1cd2f7e596af02b09982685ec75029ee4a0f776ade
6
+ metadata.gz: b01d206edd2cf234ae2c8c5092296d4a32053f65e07ede793d1c9cb29ba4be27f7f7f4801d63d352f3e27a72da1dc16ac3abb5a4a233f7432139b20fa0e07366
7
+ data.tar.gz: 3133775b0c07c1353d287e21945041b59a5499f33be639d46fad587846f9db98cb8655db7480b423a0675b0b7a7448a67788f2b4c47e4ea56afecd9382e3175b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [0.1.1] - 2026-09-15
2
+
3
+ - Add GetGem command
4
+ - Make sure new attributes don't break things
5
+
6
+ ## [0.1.0] - 2026-08-07
7
+
8
+ - Support metadata[:allow_push_host], User#email, and User#role
9
+
1
10
  ## [0.0.3] - 2025-03-20
2
11
 
3
12
  - Bump Ruby and gems and deal with breakages/deprecations
@@ -1,4 +1,8 @@
1
1
  require "foobara/all"
2
2
  require "foobara/http_api_command"
3
3
 
4
+ module Foobara::RubyGemsApi
5
+ foobara_domain!
6
+ end
7
+
4
8
  Foobara::Util.require_directory "#{__dir__}/../../src"
@@ -0,0 +1,20 @@
1
+ module Foobara
2
+ module RubyGemsApi
3
+ class GetGem < Foobara::Command
4
+ inputs do
5
+ gem_name :string, :required
6
+ end
7
+
8
+ result Gem
9
+
10
+ include HttpApiCommand
11
+
12
+ url { "https://rubygems.org/api/v1/gems/#{gem_name}.json" }
13
+
14
+ # Comment out this three lines when testing new models or looking for new attributes
15
+ def build_result
16
+ Gem.new(response_body, ignore_unexpected_attributes: true)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -10,6 +10,13 @@ module Foobara
10
10
  include HttpApiCommand
11
11
 
12
12
  url { "https://rubygems.org/api/v1/gems/#{gem_name}/owners.json" }
13
+
14
+ # Comment out this three lines when testing new models or looking for new attributes
15
+ def build_result
16
+ response_body.map do |user_attributes|
17
+ User.new(user_attributes, ignore_unexpected_attributes: true)
18
+ end
19
+ end
13
20
  end
14
21
  end
15
22
  end
@@ -10,6 +10,13 @@ module Foobara
10
10
  include HttpApiCommand
11
11
 
12
12
  url { "https://rubygems.org/api/v1/versions/#{gem_name}.json" }
13
+
14
+ # Comment out this three lines when testing new models or looking for new attributes
15
+ def build_result
16
+ response_body.map do |version_attributes|
17
+ Version.new(version_attributes, ignore_unexpected_attributes: true)
18
+ end
19
+ end
13
20
  end
14
21
  end
15
22
  end
@@ -17,6 +17,13 @@ module Foobara
17
17
  def build_request_body
18
18
  self.request_body = { query: }
19
19
  end
20
+
21
+ # Comment out this three lines when testing new models or looking for new attributes
22
+ def build_result
23
+ response_body.map do |gem_attributes|
24
+ Gem.new(gem_attributes, ignore_unexpected_attributes: true)
25
+ end
26
+ end
20
27
  end
21
28
  end
22
29
  end
@@ -0,0 +1,10 @@
1
+ module Foobara
2
+ module RubyGemsApi
3
+ class Dependency < Foobara::Model
4
+ attributes do
5
+ name :string, :required
6
+ requirements :string, :required
7
+ end
8
+ end
9
+ end
10
+ end
@@ -28,6 +28,18 @@ module Foobara
28
28
  version_downloads :integer
29
29
  info :string, :allow_nil
30
30
  authors :string
31
+ # For some reason, Search does not include this so not making it required for now
32
+ version_created_at :datetime # , :required
33
+ # This attribute is not documented so not sure of its type
34
+ ruby_abi :duck
35
+ # For some reason, Search does not include this so not making it required for now
36
+ yanked :boolean # , :required
37
+ # For some reason, Search does not include this so not making it required for now
38
+ spec_sha :string # , :required
39
+ dependencies do
40
+ development [Dependency], :required
41
+ runtime [Dependency], :required
42
+ end
31
43
  end
32
44
  end
33
45
  end
@@ -23,6 +23,8 @@ module Foobara
23
23
  requirements [:string]
24
24
  sha :string, :required
25
25
  spec_sha :string, :required
26
+ # This attribute is not documented so not sure of its type
27
+ ruby_abi :duck
26
28
  end
27
29
  end
28
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-ruby-gems-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -48,9 +48,11 @@ files:
48
48
  - LICENSE.txt
49
49
  - README.md
50
50
  - lib/foobara/ruby_gems_api.rb
51
+ - src/foobara/ruby_gems_api/get_gem.rb
51
52
  - src/foobara/ruby_gems_api/get_owners.rb
52
53
  - src/foobara/ruby_gems_api/get_versions.rb
53
54
  - src/foobara/ruby_gems_api/search.rb
55
+ - src/foobara/ruby_gems_api/types/dependency.rb
54
56
  - src/foobara/ruby_gems_api/types/gem.rb
55
57
  - src/foobara/ruby_gems_api/types/user.rb
56
58
  - src/foobara/ruby_gems_api/types/version.rb
@@ -79,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
81
  - !ruby/object:Gem::Version
80
82
  version: '0'
81
83
  requirements: []
82
- rubygems_version: 4.0.16
84
+ rubygems_version: 4.0.20
83
85
  specification_version: 4
84
86
  summary: No description. Add one.
85
87
  test_files: []