File tree Expand file tree Collapse file tree 2 files changed +29
-21
lines changed Expand file tree Collapse file tree 2 files changed +29
-21
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ require "rdoc/task"
3
3
4
4
require "bundler/gem_tasks"
5
5
6
+ spec = Bundler ::GemHelper . gemspec
7
+
6
8
desc "Run test"
7
9
task :test do
8
10
ruby ( "run-test.rb" )
11
13
task :default => :test
12
14
13
15
RDoc ::Task . new do |rdoc |
14
- rdoc . main = "README.md"
15
- files = [
16
- "LICENSE.txt" ,
17
- "NEWS.md" ,
18
- "README.md" ,
19
- "lib/**/*.rb" ,
20
- ]
21
- rdoc . rdoc_files . include ( *files )
16
+ rdoc . options = spec . rdoc_options
17
+ rdoc . rdoc_files . include ( *spec . source_paths )
18
+ rdoc . rdoc_files . include ( *spec . extra_rdoc_files )
22
19
end
23
20
24
21
benchmark_tasks = [ ]
Original file line number Diff line number Diff line change @@ -18,23 +18,34 @@ Gem::Specification.new do |spec|
18
18
spec . homepage = "https://github.com/ruby/csv"
19
19
spec . license = "BSD-2-Clause"
20
20
21
- spec . files = [
21
+ lib_path = "lib"
22
+ spec . require_paths = [ lib_path ]
23
+ files = [ ]
24
+ lib_dir = File . join ( __dir__ , lib_path )
25
+ if File . exist? ( lib_dir )
26
+ Dir . chdir ( lib_dir ) do
27
+ Dir . glob ( "**/*.rb" ) . each do |file |
28
+ files << "lib/#{ file } "
29
+ end
30
+ end
31
+ end
32
+ doc_dir = File . join ( __dir__ , "doc" )
33
+ if File . exist? ( doc_dir )
34
+ Dir . chdir ( doc_dir ) do
35
+ Dir . glob ( "**/*.rdoc" ) . each do |rdoc_file |
36
+ files << "doc/#{ rdoc_file } "
37
+ end
38
+ end
39
+ end
40
+ spec . files = files
41
+ spec . rdoc_options . concat ( [ "--main" , "README.md" ] )
42
+ rdoc_files = [
22
43
"LICENSE.txt" ,
23
44
"NEWS.md" ,
24
45
"README.md" ,
25
- "lib/csv.rb" ,
26
- "lib/csv/core_ext/array.rb" ,
27
- "lib/csv/core_ext/string.rb" ,
28
- "lib/csv/delete_suffix.rb" ,
29
- "lib/csv/fields_converter.rb" ,
30
- "lib/csv/match_p.rb" ,
31
- "lib/csv/parser.rb" ,
32
- "lib/csv/row.rb" ,
33
- "lib/csv/table.rb" ,
34
- "lib/csv/version.rb" ,
35
- "lib/csv/writer.rb" ,
36
46
]
37
- spec . require_paths = [ "lib" ]
47
+ spec . extra_rdoc_files = rdoc_files
48
+
38
49
spec . required_ruby_version = ">= 2.3.0"
39
50
40
51
spec . add_development_dependency "bundler"
You can’t perform that action at this time.
0 commit comments