[前][次][番号順一覧][スレッド一覧]

ruby-changes:62296

From: Sutou <ko1@a...>
Date: Mon, 20 Jul 2020 03:35:46 +0900 (JST)
Subject: [ruby-changes:62296] e3808c5aca (master): [ruby/csv] Add missing document files to .gem

https://git.ruby-lang.org/ruby.git/commit/?id=e3808c5aca

From e3808c5acad20f0c70e2994346fc7ea2c48269f1 Mon Sep 17 00:00:00 2001
From: Sutou Kouhei <kou@c...>
Date: Mon, 18 May 2020 05:59:14 +0900
Subject: [ruby/csv] Add missing document files to .gem

GitHub: fix GH-125

Reported by joast. Thanks!!!

https://github.com/ruby/csv/commit/bf41fa94cf

diff --git a/lib/csv/csv.gemspec b/lib/csv/csv.gemspec
index 98110bc..b2ed581 100644
--- a/lib/csv/csv.gemspec
+++ b/lib/csv/csv.gemspec
@@ -18,23 +18,34 @@ Gem::Specification.new do |spec| https://github.com/ruby/ruby/blob/trunk/lib/csv/csv.gemspec#L18
   spec.homepage      = "https://github.com/ruby/csv"
   spec.license       = "BSD-2-Clause"
 
-  spec.files         = [
+  lib_path = "lib"
+  spec.require_paths = [lib_path]
+  files = []
+  lib_dir = File.join(__dir__, lib_path)
+  if File.exist?(lib_dir)
+    Dir.chdir(lib_dir) do
+      Dir.glob("**/*.rb").each do |file|
+        files << "lib/#{file}"
+      end
+    end
+  end
+  doc_dir = File.join(__dir__, "doc")
+  if File.exist?(doc_dir)
+    Dir.chdir(doc_dir) do
+      Dir.glob("**/*.rdoc").each do |rdoc_file|
+        files << "doc/#{rdoc_file}"
+      end
+    end
+  end
+  spec.files = files
+  spec.rdoc_options.concat(["--main", "README.md"])
+  rdoc_files = [
     "LICENSE.txt",
     "NEWS.md",
     "README.md",
-    "lib/csv.rb",
-    "lib/csv/core_ext/array.rb",
-    "lib/csv/core_ext/string.rb",
-    "lib/csv/delete_suffix.rb",
-    "lib/csv/fields_converter.rb",
-    "lib/csv/match_p.rb",
-    "lib/csv/parser.rb",
-    "lib/csv/row.rb",
-    "lib/csv/table.rb",
-    "lib/csv/version.rb",
-    "lib/csv/writer.rb",
   ]
-  spec.require_paths = ["lib"]
+  spec.extra_rdoc_files = rdoc_files
+
   spec.required_ruby_version = ">= 2.3.0"
 
   spec.add_development_dependency "bundler"
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]