summaryrefslogtreecommitdiff
path: root/tool/rbinstall.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-xtool/rbinstall.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index fece0c64f2..9f6c1c76a8 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -701,14 +701,15 @@ module RbInstall
when "lib"
base = @base_dir
prefix = base.sub(/lib\/.*?\z/, "") + "lib/"
+ else
+ # other/something.gemspec ->
+ # [other/something.rb, other/something/foo.rb, ...]
+ base = @gemspec.chomp('.gemspec')
+ prefix = @base_dir
end
- if base
- Dir.glob("#{base}{.rb,/**/*.rb}").collect do |ruby_source|
- remove_prefix(prefix, ruby_source)
- end
- else
- [File.basename(@gemspec, '.gemspec') + '.rb']
+ Dir.glob("#{base}{.rb,/**/*.rb}").collect do |ruby_source|
+ remove_prefix(prefix, ruby_source)
end
end