class RiceMakefileCreator::MakefileWriter
Public Class Methods
new(file, mode) { |file| ... }
click to toggle source
Calls superclass method
# File ruby/lib/lib/ruby/site_ruby/2.2/mkmf-rice.rb, line 163 def self.new(file, mode) file = super(file, mode) if block_given? then begin yield file ensure file.close if not file.closed? end else return file end end
new(file, mode)
click to toggle source
# File ruby/lib/lib/ruby/site_ruby/2.2/mkmf-rice.rb, line 176 def initialize(file, mode) @file = File.open(file, mode) end
Public Instance Methods
close()
click to toggle source
# File ruby/lib/lib/ruby/site_ruby/2.2/mkmf-rice.rb, line 197 def close @file.close end
closed?()
click to toggle source
# File ruby/lib/lib/ruby/site_ruby/2.2/mkmf-rice.rb, line 201 def closed? return @file.closed? end
print(*strings)
click to toggle source
# File ruby/lib/lib/ruby/site_ruby/2.2/mkmf-rice.rb, line 180 def print(*strings) strings.each do |string| # Make sure -lruby comes after -lrice (necessary on some # platforms) string = string.to_s.gsub(/^(LIBS\s*=\s*)(#{Regexp.quote($LIBRUBYARG)})\s+(.*)\s+(#{$LIBS})$/, '\1\3\2 \4') @file.print(string) end end
printf(format, *args)
click to toggle source
# File ruby/lib/lib/ruby/site_ruby/2.2/mkmf-rice.rb, line 189 def printf(format, *args) @file.printf(format, *args) end
puts(*strings)
click to toggle source
# File ruby/lib/lib/ruby/site_ruby/2.2/mkmf-rice.rb, line 193 def puts(*strings) print(*strings.flatten.map { |s| "#{s}\n" }) end