foobara-ruby-gems-api 0.1.0 → 0.1.2

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: 779512982b3f46125c7baf501e369486dea335068bdb399325bcb167077bd388
4
+ data.tar.gz: 7880b0634b1e2915c0c42c2c9e48660988213dbe8a9f7c7d2b4cabaa58e77aec
5
5
  SHA512:
6
- metadata.gz: 61ea1b99406a72586256536df731eb8d67e9c698437b7562e9239981662f9835f924a0fd627671c99b7769a3d56a7b62a8b5921a2420bc13b9de4077ad7971a7
7
- data.tar.gz: 3e1f22c6682f19c1d41f84ee77e208d5b1299d0af3a181ba0749c586c15c45faf53b5d36a837f66a9a624c1cd2f7e596af02b09982685ec75029ee4a0f776ade
6
+ metadata.gz: 6c37b5adaa9b5db49c5728171ea5d8fe8429b1f071bec05be1e3c817359fefe75ead0c32084e012d1a4802f5e0aebd53ca57473b7d2c8cd63782e55162339baa
7
+ data.tar.gz: 46f9192ce4b8b4d429570e56e95c1c715637d714bab0d5ac7f86bfad51c30edb74fba51e7c04edadbef9a0466320f63c3e1216c042944cafe8c69513f270631f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## [0.1.2] - 2026-10-22
2
+
3
+ - Fix bug caused by older versions of gems not having a ruby_version attribute
4
+
5
+ ## [0.1.1] - 2026-09-15
6
+
7
+ - Add GetGem command
8
+ - Make sure new attributes don't break things
9
+
10
+ ## [0.1.0] - 2026-08-07
11
+
12
+ - Support metadata[:allow_push_host], User#email, and User#role
13
+
1
14
  ## [0.0.3] - 2025-03-20
2
15
 
3
16
  - 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"
data/src/get_gem.rb ADDED
@@ -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
@@ -17,12 +17,14 @@ module Foobara
17
17
  summary :string
18
18
  platform :string
19
19
  rubygems_version :string
20
- ruby_version :string
20
+ ruby_version :string, :allow_nil
21
21
  prerelease :boolean
22
22
  licenses [:string]
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -13,6 +13,9 @@ dependencies:
13
13
  name: foobara
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 0.7.5
16
19
  - - "<"
17
20
  - !ruby/object:Gem::Version
18
21
  version: 2.0.0
@@ -20,6 +23,9 @@ dependencies:
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.7.5
23
29
  - - "<"
24
30
  - !ruby/object:Gem::Version
25
31
  version: 2.0.0
@@ -48,12 +54,14 @@ files:
48
54
  - LICENSE.txt
49
55
  - README.md
50
56
  - lib/foobara/ruby_gems_api.rb
51
- - src/foobara/ruby_gems_api/get_owners.rb
52
- - src/foobara/ruby_gems_api/get_versions.rb
53
- - src/foobara/ruby_gems_api/search.rb
54
- - src/foobara/ruby_gems_api/types/gem.rb
55
- - src/foobara/ruby_gems_api/types/user.rb
56
- - src/foobara/ruby_gems_api/types/version.rb
57
+ - src/get_gem.rb
58
+ - src/get_owners.rb
59
+ - src/get_versions.rb
60
+ - src/search.rb
61
+ - src/types/dependency.rb
62
+ - src/types/gem.rb
63
+ - src/types/user.rb
64
+ - src/types/version.rb
57
65
  homepage: https://github.com/foobara/ruby-gems-api
58
66
  licenses:
59
67
  - MPL-2.0
@@ -79,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
87
  - !ruby/object:Gem::Version
80
88
  version: '0'
81
89
  requirements: []
82
- rubygems_version: 4.0.16
90
+ rubygems_version: 4.0.20
83
91
  specification_version: 4
84
92
  summary: No description. Add one.
85
93
  test_files: []
File without changes