Skip to content

Commit

Permalink
Merge #3060
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bundlerbot and colby-swandale committed Jan 31, 2020
2 parents 5dbf4f4 + 819c784 commit 8669a64
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/rubygems/specification.rb
Expand Up @@ -384,6 +384,7 @@ def licenses=(licenses)
# "mailing_list_uri" => "https://groups.example.com/bestgemever",
# "source_code_uri" => "https://example.com/user/bestgemever",
# "wiki_uri" => "https://example.com/user/bestgemever/wiki"
# "funding_uri" => "https://example.com/donate"
# }
#
# These links will be used on your gem's page on rubygems.org and must pass
Expand Down
1 change: 1 addition & 0 deletions lib/rubygems/specification_policy.rb
Expand Up @@ -18,6 +18,7 @@ class Gem::SpecificationPolicy
mailing_list_uri
source_code_uri
wiki_uri
funding_uri
].freeze # :nodoc:

def initialize(specification)
Expand Down
3 changes: 2 additions & 1 deletion test/rubygems/test_gem_specification.rb
Expand Up @@ -3532,7 +3532,8 @@ def test_metadata_validates_ok
s.metadata = {
"one" => "two",
"home" => "three",
"homepage_uri" => "https://example.com/user/repo"
"homepage_uri" => "https://example.com/user/repo",
"funding_uri" => "https://example.com/donate"
}
end

Expand Down

0 comments on commit 8669a64

Please sign in to comment.