Top Level Namespace

Defined Under Namespace

Modules: HomeQ Classes: Foo, TC_MyTest

Constant Summary collapse

HOMEQ_VERSION =
"1.1.4"
HOMEQ_ROOT =
File.expand_path("#{File.dirname(__FILE__)}/..")
HOMEQ_ENV =
(ENV['HOMEQ_ENV'] || 'production')

Instance Method Summary collapse

Instance Method Details

#copy_with_rewritten_ruby_path(src_file, dest_file) ⇒ Object



1
2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/tasks/utility.rb', line 1

def copy_with_rewritten_ruby_path(src_file, dest_file)
  File.open(dest_file, 'w') do |df|
    File.open(src_file) do |sf|
      line = sf.gets
      if (line =~ /#!.+ruby\s*/) != nil
        df.puts("#!#{system_ruby_path}")
      else
        df.puts(line)
      end
      df.write(sf.read)
    end
  end
end

#system_ruby_pathObject



15
16
17
# File 'lib/tasks/utility.rb', line 15

def system_ruby_path
  File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
end