foobara-ruby-gems-api 0.0.3 → 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: 14d3596c7bb9190012461d5d2d764df01d280c7f21bfc35eb23c2132b9c36bf2
4
- data.tar.gz: 3b3d53e30514e7115a7a6f434f626688fe7620c8cbdb7c5b893d0efd9667110b
3
+ metadata.gz: 77f104d162c3782a13a4cf777f68c6628695bc71d9b80b719b05599012d40412
4
+ data.tar.gz: 5ff81b6947cbf488ac7186e83a3734bc73470bb717e02875479e413253efb39a
5
5
  SHA512:
6
- metadata.gz: 0440c20ea8368f9e5d75390e09ead41635d7506a3480383f92bafcc1ccfb5e2382938c9b80a4199f6cccd245985d83cff69f10a1f00b53362e1c23be24315c21
7
- data.tar.gz: 14c147553b9f3d6c8819d80238ff6d56aafe21d49564fecc607cf79dc24987c43621861f91313ae42f9737f37ea34a89668a0be7843baf69c26b03eb04e65ffe
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
data/README.md CHANGED
@@ -1,43 +1,18 @@
1
- # Foobara::EmptyRubyProjectGenerator
1
+ # Foobara::RubyGemsApi
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library
6
- into a gem. Put your Ruby code in the file `lib/foobara/empty_ruby_project_generator`. To experiment with that code,
7
- run `bin/console` for an interactive prompt.
3
+ Provides commands that invoke the rubygems.org REST HTTP API endpoints.
8
4
 
9
5
  ## Installation
10
6
 
11
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it
12
- to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with
13
- instructions to install your gem from git if you don't plan to release to RubyGems.org.
14
-
15
- Install the gem and add to the application's Gemfile by executing:
16
-
17
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
18
-
19
- If bundler is not being used to manage dependencies, install the gem by executing:
20
-
21
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
7
+ TODO
22
8
 
23
9
  ## Usage
24
10
 
25
- TODO: Write usage instructions here
11
+ TODO
26
12
 
27
13
  ## Development
28
14
 
29
- If using Foobara locally, then run the following (TODO: make this no-longer necessary.)
30
-
31
- ```bash
32
- bundle config set disable_local_branch_check true
33
- ```
34
-
35
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can
36
- also run `bin/console` for an interactive prompt that will allow you to experiment.
37
-
38
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
39
- version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
40
- push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
15
+ TODO
41
16
 
42
17
  ## Contributing
43
18
 
@@ -46,5 +21,5 @@ at https://github.com/[USERNAME]/foobara-empty_ruby_project_generator.
46
21
 
47
22
  ## License
48
23
 
49
- This files in this project are licensed under the
24
+ The files in this project are licensed under the
50
25
  Mozilla Public License Version 2.0. Please see LICENSE.txt for more info.
@@ -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
@@ -8,6 +8,7 @@ module Foobara
8
8
  rubygems_mfa_required :boolean
9
9
  changelog_uri :string, :allow_nil
10
10
  source_code_uri :string, :allow_nil
11
+ allowed_push_host :string, :allow_nil
11
12
  end
12
13
  homepage_uri :string, :allow_nil
13
14
  funding_uri :string, :allow_nil
@@ -27,6 +28,18 @@ module Foobara
27
28
  version_downloads :integer
28
29
  info :string, :allow_nil
29
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
30
43
  end
31
44
  end
32
45
  end
@@ -4,6 +4,8 @@ module Foobara
4
4
  attributes do
5
5
  id :integer, :required
6
6
  handle :string, :required
7
+ email :string
8
+ role :string, :required, one_of: [:owner, :maintainer]
7
9
  end
8
10
  end
9
11
  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,42 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-ruby-gems-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ">="
16
+ - - "<"
17
17
  - !ruby/object:Gem::Version
18
- version: '0'
18
+ version: 2.0.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - ">="
23
+ - - "<"
24
24
  - !ruby/object:Gem::Version
25
- version: '0'
25
+ version: 2.0.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: foobara-http-api-command
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - ">="
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '0'
32
+ version: 2.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
37
+ - - "<"
38
38
  - !ruby/object:Gem::Version
39
- version: '0'
39
+ version: 2.0.0
40
40
  email:
41
41
  - azimux@gmail.com
42
42
  executables: []
@@ -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
@@ -69,14 +71,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
71
  requirements:
70
72
  - - ">="
71
73
  - !ruby/object:Gem::Version
72
- version: 3.4.0
74
+ version: '3.4'
75
+ - - "<"
76
+ - !ruby/object:Gem::Version
77
+ version: '4.1'
73
78
  required_rubygems_version: !ruby/object:Gem::Requirement
74
79
  requirements:
75
80
  - - ">="
76
81
  - !ruby/object:Gem::Version
77
82
  version: '0'
78
83
  requirements: []
79
- rubygems_version: 3.6.6
84
+ rubygems_version: 4.0.20
80
85
  specification_version: 4
81
86
  summary: No description. Add one.
82
87
  test_files: []