|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -lib = File.expand_path("lib", __dir__) |
4 | | -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) |
5 | | -require "http/form_data/version" |
| 3 | +require_relative "lib/http/form_data/version" |
6 | 4 |
|
7 | 5 | Gem::Specification.new do |spec| |
8 | 6 | spec.name = "http-form_data" |
9 | 7 | spec.version = HTTP::FormData::VERSION |
10 | | - spec.homepage = "https://github.com/httprb/form_data.rb" |
11 | 8 | spec.authors = ["Aleksey V Zapparov"] |
12 | 9 | spec.email = ["ixti@member.fsf.org"] |
| 10 | + |
| 11 | + spec.summary = "Build form data request bodies" |
| 12 | + spec.homepage = "https://github.com/httprb/form_data" |
13 | 13 | spec.license = "MIT" |
14 | | - spec.summary = "http-form_data-#{HTTP::FormData::VERSION}" |
15 | | - spec.description = <<-DESC.gsub(/^\s+> /m, "").tr("\n", " ").strip |
16 | | - > Utility-belt to build form data request bodies. |
17 | | - > Provides support for `application/x-www-form-urlencoded` and |
18 | | - > `multipart/form-data` types. |
19 | | - DESC |
20 | | - |
21 | | - spec.metadata["changelog_uri"] = "https://github.com/httprb/form_data/blob/master/CHANGES.md" |
| 14 | + |
| 15 | + spec.description = <<~DESCRIPTION.strip.gsub(/\s+/, " ") |
| 16 | + Utility-belt to build form data request bodies. |
| 17 | + Provides support for `application/x-www-form-urlencoded` and |
| 18 | + `multipart/form-data` types. |
| 19 | + DESCRIPTION |
| 20 | + |
| 21 | + spec.metadata["homepage_uri"] = spec.homepage |
| 22 | + spec.metadata["source_code_uri"] = "#{spec.homepage}/tree/v#{spec.version}" |
| 23 | + spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues" |
| 24 | + spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/v#{spec.version}/CHANGES.md" |
| 25 | + spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/http-form_data/#{spec.version}" |
22 | 26 | spec.metadata["rubygems_mfa_required"] = "true" |
23 | 27 |
|
24 | | - spec.files = `git ls-files -z`.split("\x0") |
25 | | - spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) } |
| 28 | + spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls| |
| 29 | + extras = %w[CHANGES.md LICENSE.txt README.md] << File.basename(__FILE__) |
| 30 | + |
| 31 | + ls.readlines("\x0", chomp: true).select do |f| |
| 32 | + f.start_with?("lib/", "sig/") || extras.include?(f) |
| 33 | + end |
| 34 | + end |
| 35 | + |
26 | 36 | spec.require_paths = ["lib"] |
27 | 37 |
|
28 | 38 | spec.required_ruby_version = ">= 3.2" |
|
0 commit comments