Skip to content

Commit 8669a64

Browse files
bundlerbotColby Swandale
andcommitted
Merge #3060
3060: Add `funding_uri ` metadata field to gemspec r=bronzdoc a=colby-swandale # Description: I want to add a new metadata field to the gemspec called `funding_uri` for the purpose of linking a page which users can view on how to donate to/sponsor gem authors. With the introduction of [Github Sponsors](https://github.com/sponsors), [Tidlelift](https://tidelift.com/), [Open Collective](https://opencollective.com) & [Patreon](https://www.patreon.com/), donating or sponsoring a developer is now super easy and streamlined. I hope by adding this field to accomplish a number of goals: * Similar to npmjs.org, we add a button/ui element to the gem page on rubygems.org to link visitors to the given donation uri. * Encourage tooling to be built to list information about how to donate to gem authors for a given Gemfile, Gemfile.lock. (similar to the new `npm fund` command npm/cli#273) * Encourage more maintainers to signup and receive sponsorship for their work # Tasks: - [ ] Describe the problem / feature - [ ] Write tests - [ ] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md). Co-authored-by: Colby Swandale <me@colby.fyi>
2 parents 5dbf4f4 + 819c784 commit 8669a64

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

lib/rubygems/specification.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ def licenses=(licenses)
384384
# "mailing_list_uri" => "https://groups.example.com/bestgemever",
385385
# "source_code_uri" => "https://example.com/user/bestgemever",
386386
# "wiki_uri" => "https://example.com/user/bestgemever/wiki"
387+
# "funding_uri" => "https://example.com/donate"
387388
# }
388389
#
389390
# These links will be used on your gem's page on rubygems.org and must pass

lib/rubygems/specification_policy.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Gem::SpecificationPolicy
1818
mailing_list_uri
1919
source_code_uri
2020
wiki_uri
21+
funding_uri
2122
].freeze # :nodoc:
2223

2324
def initialize(specification)

test/rubygems/test_gem_specification.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3532,7 +3532,8 @@ def test_metadata_validates_ok
35323532
s.metadata = {
35333533
"one" => "two",
35343534
"home" => "three",
3535-
"homepage_uri" => "https://example.com/user/repo"
3535+
"homepage_uri" => "https://example.com/user/repo",
3536+
"funding_uri" => "https://example.com/donate"
35363537
}
35373538
end
35383539

0 commit comments

Comments
 (0)