Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
mreinsch-csv_builder
Advanced tools
= CSV Builder
The CSV Builder Rails plugin provides a simple templating system for serving dynamically generated CSV files from your application.
== Requirements
CSV Builder requires Rails v2.1.
It also depends upon the FasterCSV gem http://fastercsv.rubyforge.org, which you can install with
$ sudo gem install fastercsv
Encoding conversions are done with Iconv, so make sure you have it on your development/production machine.
== Install
=== Install as gem (recommended)
Install as a gem:
$ sudo gem install mreinsch-csv_builder
Then add the gem dependency in your config:
config.gem "mreinsch-csv_builder", :source => "http://gems.github.com", :lib => "csv_builder"
=== Install as plugin
To install as a plugin, use:
$ ./script/plugin install git://github.com/mreinsch/csv_builder.git
== Example
CSV template files are suffixed with '.csv.csvbuilder', for example 'index.csv.csvbuilder'
Add rows to your CSV file in the template by pushing arrays of columns into the csv object.
csv << [ 'cell 1', 'cell 2' ]
csv << [ 'another cell value', 'and another' ]
You can set the default filename for that a browser will use for 'save as' by setting @filename instance variable in your controller's action method e.g.
@filename = 'report.csv'
You can set the input encoding and output encoding by setting @input_encoding and @output_encoding instance variables. These default to 'UTF-8' and 'LATIN1' respectively. e.g.
@output_encoding = 'UTF-8'
You can set @csv_options instance variable to define options for FasterCSV generator. For example:
@csv_options = { :force_quotes => true, :col_sep => ';' }
You can also attach a csv file to mail sent out by your application by including a snippet like the following in your mailer method
attachment "text/csv" do |attachment| attachment.body = render(:file => 'example/index.csv.csvbuilder') attachment.filename = 'report.csv' end
Copyright (c) 2008 Econsultancy.com and 2009 Vidmantas Kabošis, released under the MIT license.
FAQs
Unknown package
We found that mreinsch-csv_builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.