"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/ruport.rb" between
ruport-1.7.1.tar.gz and ruport-1.8.0.tar.gz

About: Ruport (Ruby Reports) is a simple, extensible reporting system built for Rubyists. It provides tools for data acquisition, database interaction, formatting, and parsing/munging.

ruport.rb  (ruport-1.7.1):ruport.rb  (ruport-1.8.0)
skipping to change at line 63 skipping to change at line 63
'L' ) 'L' )
m_GetConsoleScreenBufferInfo = Win32API.new( m_GetConsoleScreenBufferInfo = Win32API.new(
'kernel32', 'GetConsoleScreenBufferInfo', ['L', 'P'], 'L' 'kernel32', 'GetConsoleScreenBufferInfo', ['L', 'P'], 'L'
) )
format = 'SSSSSssssSS' format = 'SSSSSssssSS'
buf = ([0] * format.size).pack(format) buf = ([0] * format.size).pack(format)
stdout_handle = m_GetStdHandle.call(0xFFFFFFF5) stdout_handle = m_GetStdHandle.call(0xFFFFFFF5)
m_GetConsoleScreenBufferInfo.call(stdout_handle, buf) m_GetConsoleScreenBufferInfo.call(stdout_handle, buf)
bufx, bufy, curx, cury, wattr, _bufx, _bufy, _curx, _cury, _wattr, left, top, right, bottom, _maxx, _ma
left, top, right, bottom, maxx, maxy = buf.unpack(format) xy = buf.unpack(format)
return right - left + 1, bottom - top + 1 return right - left + 1, bottom - top + 1
end end
rescue LoadError # If we're not on Windows try... rescue LoadError # If we're not on Windows try...
# A Unix savvy method to fetch the console columns, and rows. # A Unix savvy method to fetch the console columns, and rows.
def terminal_size def terminal_size
size = if /solaris/ =~ RUBY_PLATFORM size = if /solaris/ =~ RUBY_PLATFORM
output = `stty` output = `stty 2>&1`
[output.match('columns = (\d+)')[1].to_i, [output.match('columns = (\d+)')[1].to_i,
output.match('rows = (\d+)')[1].to_i] output.match('rows = (\d+)')[1].to_i]
else else
`stty size`.split.map { |x| x.to_i }.reverse `stty size 2>&1`.split.map { |x| x.to_i }.reverse
end end
return $? == 0 ? size : [80,24] return $? == 0 ? size : [80,24]
end end
end
end def terminal_width
terminal_size.first
def terminal_width end
terminal_size.first
end
end end
# quiets warnings for block # quiets warnings for block
def quiet #:nodoc: def quiet #:nodoc:
warns = $VERBOSE warns = $VERBOSE
$VERBOSE = nil $VERBOSE = nil
result = yield result = yield
$VERBOSE = warns $VERBOSE = warns
return result return result
end end
module_function :quiet module_function :quiet
end end
require "ruport/version" require "ruport/version"
require "enumerator"
require "ruport/controller" require "ruport/controller"
require "ruport/data" require "ruport/data"
require "ruport/formatter" require "ruport/formatter"
begin begin
if Object.const_defined? :ActiveRecord if Object.const_defined? :ActiveRecord
require "ruport/acts_as_reportable" require "ruport/acts_as_reportable"
end end
rescue LoadError rescue LoadError
nil nil
 End of changes. 6 change blocks. 
11 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)