Skip to content

Instantly share code, notes, and snippets.

View mmcc's full-sized avatar
📺
Movin vidja bits

Matthew McClure mmcc

📺
Movin vidja bits
View GitHub Profile
@mmcc
mmcc / iTermOutput
Created November 30, 2011 21:55
precompile error
/usr/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:52:in `initialize': Valid types are [:development, :runtime], not nil (ArgumentError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:352:in `new'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:352:in `search'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:346:in `gems_size'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:179:in `resolve'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:95:in `sort_by'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:175:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:175:in `sort_by'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:175:in `resolve'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:160:in `start'
@mmcc
mmcc / _products.iphone.erb
Created November 30, 2011 20:36
Products partial
<% if products.any? %>
<ul id="products" title="<%= t(:search_results, :keywords => h(params[:keywords])) %>" selected="true" class="product-listing" data-hook>
<% products.each do |product| %>
<% if Spree::Config[:show_zero_stock_products] || product.has_stock? %>
<li id="product_<%= product.id %>" data-hook="products_list_item">
<%= link_to product.name, product, :class => 'info' %>
<span class="price selling"><%= product_price(product) %></span>
</li>
<% end %>
<% end %>
@mmcc
mmcc / home_controller_decorator.rb
Created November 30, 2011 01:01
home controller
HomeController.class_eval do
def index
@searcher = Spree::Config.searcher_class.new(params)
@products = @searcher.retrieve_products
respond_with(@products)
respond_with do |format|
format.html { render :action => params[:path] }
format.iphone { render :layout => false }
end
@mmcc
mmcc / fulltrace
Created November 30, 2011 00:51
Full Trace after adding home controller decorator
spree_core (0.70.3) app/views/shared/_products.html.erb:5:in `___ibrary__uby__ems_____gems_spree_core________app_views_shared__products_html_erb___911215525_2255387160'
actionpack (3.1.1) lib/action_view/template.rb:144:in `send'
actionpack (3.1.1) lib/action_view/template.rb:144:in `render'
activesupport (3.1.1) lib/active_support/notifications.rb:55:in `instrument'
actionpack (3.1.1) lib/action_view/template.rb:142:in `render'
actionpack (3.1.1) lib/action_view/renderer/partial_renderer.rb:256:in `render_partial'
actionpack (3.1.1) lib/action_view/renderer/partial_renderer.rb:228:in `render'
actionpack (3.1.1) lib/action_view/renderer/abstract_renderer.rb:33:in `instrument'
activesupport (3.1.1) lib/active_support/notifications.rb:53:in `instrument'
activesupport (3.1.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
@mmcc
mmcc / base_controller_decorator.rb
Created November 29, 2011 23:45
Content Controller Decorator dump
Spree::BaseController.class_eval do
before_filter :adjust_format_for_iphone
# before_filter :iphone_login_required
respond_to do |format|
format.iphone { render :layout => false }
end
private