![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Cbuilder is an ultralight (< 100 LOC) CSV builder/template handler inspired by dhh's excellent Jbuilder. The goal is a simple DSL for creating CSV files that's better than creating massive custom arrays.
If you're doing any more than 4-5 columns, generating CSV files can be a real pain. God forbid you're not simply outputting the attributes of a simple array, and need helpers or other niceties.
You don't need to re-invent the wheel with CSV. Cbuilder weighs in at less than 100 LOC.
Have you ever found yourself doing this?
Customer Name,Products Purchased, Product Names
<% @orders.each do |order|%>
<%= order.customer.name %>,<%= products_count(order) %>,<%= product_names(order.products) %>,...
<% end %>
What if you could do this instead?
Cbuilder.encode do |csv|
csv.set_collection!(@orders) do |order|
csv.col 'Customer Name', order.customer.name
csv.col 'Products Purchased', products_count(order)
csv.col 'Product Names', product_names(order.products)
end
end
Add this line to your application's Gemfile:
gem 'cbuilder'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cbuilder
Just drop into your Rails Gemfile and start adding templates with *.csv.cbuilder.
If you'd like the CSV to be downloaded as an attachment, add the following to your controller action:
response.headers["Content-Disposition"] = 'attachment; filename="my_spreadsheet.csv'
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)Cbuilder was built by Craft Coffee
FAQs
Unknown package
We found that cbuilder 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.