Changeset 1091
- Timestamp:
- 06/12/07 16:48:19 (1 year ago)
- Files:
-
- plugins/fcsv_formatter (added)
- plugins/fcsv_formatter/Rakefile (added)
- plugins/fcsv_formatter/lib (added)
- plugins/fcsv_formatter/lib/fcsv_formatter (added)
- plugins/fcsv_formatter/lib/fcsv_formatter/init.rb (added)
- plugins/fcsv_formatter/pkg (added)
- plugins/fcsv_formatter/pkg/fcsv_formatter-0.1.0.gem (added)
- plugins/fcsv_formatter/pkg/pdf_writer_proxy-0.1.0.gem (added)
- ruport-util/trunk/lib/ruport/util/report.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ruport-util/trunk/lib/ruport/util/report.rb
r1071 r1091 54 54 # result = query "select * from foo" 55 55 # 56 # #from file57 # result = query "my_query.sql", :origin => :file58 #59 56 # You can use multistatement SQL: 60 57 # … … 73 70 # result = query "select * from foo", :raw_data => true 74 71 # 75 # You can quickly output in a number of formats:76 #77 # result = query "select * from foo", :as => :csv78 # result = query "select * from foo", :as => :html79 # result = query "select * from foo", :as => :pdf80 72 # 81 73 # See Ruport::Query for details. 82 74 # 83 75 def query(sql, options={}) 84 options[:source] ||= :default 85 q = options[:query_obj] ||Ruport::Query.new(sql, options)76 options[:source] ||= :default 77 q = Ruport::Query.new(sql, options) 86 78 if block_given? 87 79 q.each { |r| yield(r) } 88 elsif options[:as]89 q.result.as(options[:as])90 80 else 91 81 q.result
