lib/rip/setup.rb in rip-0.0.2 vs lib/rip/setup.rb in rip-0.0.3
- old
+ new
@@ -98,10 +98,11 @@
def install_binary(verbose = false)
transaction "installing rip binary" do
src = File.join(RIPROOT, 'bin', 'rip')
dst = File.join(BINDIR, 'rip')
FileUtils.cp src, dst, :verbose => verbose, :preserve => true
+ FileUtils.chmod(0755, dst)
ruby_bin = File.expand_path(File.join(BINDIR, RbConfig::CONFIG['ruby_install_name']))
if File.exist? ruby_bin
ui.puts "rip: using Ruby bin: #{ruby_bin}"
rewrite_bang_line(dst, "#!#{ruby_bin}")
@@ -256,10 +257,10 @@
def rewrite_bang_line(file, first_line)
lines = File.readlines(file)[1..-1]
File.open(file, 'w') do |f|
f.puts first_line
- f.puts lines.join("\n")
+ f.puts lines.join
f.flush
end
end
def ui