Skip to content

Instantly share code, notes, and snippets.

%: rake new_cookbook COOKBOOK=ci_setup
%: ey recipes upload -e YOUR_ENVIRONMENT
<?xml version="1.0" encoding="utf-8"?>
<mx:Module
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:views="com.woople.admin.ui.views.*"
xmlns:maps="com.woople.admin.maps.*"
xmlns:c="com.woople.shared.ui.controls.*"
width="100%" height="100%"
minWidth="972" minHeight="484">
<mx:Script>
<?xml version="1.0" encoding="utf-8"?>
<!-- build.xml -->
<project name="Flex Ant Tasks Build Script" basedir="." default="compile_modules">
<taskdef resource="flexTasks.tasks" classpath="${basedir}/vendor/flex/ant/lib/flexTasks.jar" />
<property name="FLEX_HOME" value="${basedir}/vendor/flex"/>
<property name="APP_ROOT" value="${basedir}/app/flex"/>
<property name="DEPLOY_DIR" value="${basedir}/public/bin-release" />
<property name="DEBUG" value="false" />
<?xml version="1.0" encoding="utf-8"?>
<s:SkinnableDataContainer
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
skinClass="com.woople.shared.ui.skins.ModuleSectionStackSkin">
<fx:Script>
<![CDATA[
@awd
awd / gist:601480
Created September 28, 2010 18:18
# this responder allows the system to render a streaming proc
# rendering a proc was removed in Rails 3.0
ActionController::Renderers.add :csv do |proc, options|
raise ArgumentError "CSV responder requires :filename" unless options.key? :filename
filename = options[:filename]
headers.merge!(
'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
'Content-Disposition' => "attachment; filename=\"#{filename}\"",
# this renderer allows the system to render progressively generated content
# rendering a proc was removed in Rails 3.0
ActionController::Renderers.add :csv do |detailed_report, options|
filename = detailed_report.to_filename
headers['Cache-Control'] = 'must-revalidate, post-check=0, pre-check=0'
headers['Content-Disposition'] = "attachment; filename=#{filename}"
headers['Content-Type'] = 'text/csv'
headers['Content-Transfer-Encoding'] = 'binary'
class ProgressiveController < ApplicationController
def show
respond_to do |wants|
wants.csv {
render :csv => ProgressiveContent.new, :status => :ok
}
end
end
end
class ProgressiveContent
# additionally you could pass in arguments
# to help initialize a specific scope
def initialize
@generated = false
@test_response = false
end
# this method is used in the CSV Responder
[Tue, 28 Jun 2011 12:55:51 -0700] INFO: Starting Chef Solo Run
/etc/chef-custom/recipes/cookbooks/passenger_memory_increase/recipes/default.rb:5:in `from_file': undefined method `environment' for #<Mash:0xb780fe28> (NoMethodError)
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/cookbook.rb:139:in `load_recipe'
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:76:in `include_recipe'
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:63:in `each'
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:63:in `include_recipe'
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:82:in `require_recipe'
from /etc/chef-custom/recipes/cookbooks/main/recipes/default.rb:73:in `from_file'
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/cookbook.rb:139:in `load_recipe'
from /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2