Skip to content

Commit a93499e

Browse files
author
nahi
committed
Install logger.rb to RUBYLIBDIR, not site_dir under 1.8.
1 parent 24bcea9 commit a93499e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

install.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
include Config
66

77
RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
8+
RUBYLIBDIR = CONFIG["rubylibdir"]
89
DSTPATH = CONFIG["sitedir"] + "/" + RV
910

1011
def join(*arg)
@@ -16,14 +17,17 @@ def base(name)
1617
end
1718

1819
begin
19-
File.mkpath(join(DSTPATH, "devel"), true)
20-
Dir['lib/devel/*.rb'].each do |name|
21-
File.install(name, join(DSTPATH, 'devel', base(name)), 0644, true)
22-
end
23-
Dir['lib/*.rb'].each do |name|
20+
name = join('lib', 'logger.rb')
21+
if RUBY_VERSION >= '1.8.0'
22+
File.install(name, join(RUBYLIBDIR, base(name)), 0644, true)
23+
else
2424
File.install(name, join(DSTPATH, base(name)), 0644, true)
2525
end
2626

27+
name = join('lib', 'devel', 'logger.rb')
28+
File.mkpath(join(DSTPATH, "devel"), true)
29+
File.install(name, join(DSTPATH, 'devel', base(name)), 0644, true)
30+
2731
puts "install succeed!"
2832

2933
rescue

0 commit comments

Comments
 (0)