Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
887 lines (464 sloc) 31.3 KB
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>cmar blog</title>
<meta name="author" content="Chris Mar">
<meta name="description" content="I opened SpreeConfDC with a talk on the current state of the Spree community and a discussion of the new Split Shipments in Spree 2.0. I&#8217;m &hellip;">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://cmar.github.com">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="/javascripts/ender.js"></script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<link href="/atom.xml" rel="alternate" title="cmar blog" type="application/atom+xml">
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30097567-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body >
<header role="banner"><hgroup>
<h1><a href="/">cmar blog</a></h1>
<h2>Spree Engineer.</h2>
</hgroup>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="http://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:cmar.github.com" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/blog/archives">Archives</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/06/08/fun-with-shipments-at-spreeconfdc/">Fun With Shipments at SpreeConfDC</a></h1>
<p class="meta">
<time datetime="2013-06-08T06:42:00-04:00" pubdate data-updated="true">Jun 8<span>th</span>, 2013</time>
</p>
</header>
<div class="entry-content"><p>I opened SpreeConfDC with a talk on the current state of the Spree community and a discussion of the new Split Shipments in Spree 2.0. I&#8217;m really proud of the design and hard work the core team put into building this powerful feature.</p>
<p>Split Shipments was designed to help store owners of all sizes. The default behavior will be familiar to long time Spree users. But underneath lies a powerful set of constructs to help your store grow from a single location to a world wide enterprise.</p>
<p>This post gathers the video and slides for my talk. Thanks to
<a href="http://twitter.com/nate_edwards80">Nate Edwards</a> who recorded my talk and published it in 2 parts.</p>
<iframe width="560" height="315" src="http://www.youtube.com/embed/Tn2TZb9zzG0" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="http://www.youtube.com/embed/8kMFSEj_ASc" frameborder="0" allowfullscreen></iframe>
<script async class="speakerdeck-embed" data-id="591272f0a6020130eec33aee331b8d2d" data-ratio="1.2994923857868" src="//speakerdeck.com/assets/embed.js"></script>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/03/18/bundle-searching/">Bundle Searching</a></h1>
<p class="meta">
<time datetime="2013-03-18T10:27:00-04:00" pubdate data-updated="true">Mar 18<span>th</span>, 2013</time>
</p>
</header>
<div class="entry-content"><p>Jim Gay (<a href="https://twitter.com/saturnflyer">@saturnflyer</a>) posted a <a href="http://www.saturnflyer.com/blog/jim/2013/03/15/searching-through-your-bundled-gems">great tip</a> for using <a href="https://github.com/ggreer/the_silver_searcher">The Silver Searcher</a> to find the occurrence of a word within the gem dependencies for your project.</p>
<p>Bundler has had requests for search capabilities. Rule #2 of the Unix Philosophy is make each program do one thing well. The Silver Searcher is my current favorite searching tool. Its replaced grep and ack for all my code searching. Following rule #2, we don&#8217;t need bundler to search for us, we just need to compose it together with the best search tool.</p>
<p>Its a simple idea. Jim Gay wrote about it. I thought it was brilliant. I created an alias to make it easy to use:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>alias bs="bundle show --paths | xargs ag"</span></code></pre></td></tr></table></div></figure>
<p>Now, inside a project I can run &#8216;bs user&#8217; to search for the word &#8216;user&#8217; within all the gems included in my project. Is this fast? Yes! Inside a Spree sandbox - which has 81 gem dependencies - I can search for a common word like &#8216;user&#8217; in 3.339s.</p>
<p>Thanks for the idea Jim!</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/08/10/defacing-your-views/">Defacing Your Views</a></h1>
<p class="meta">
<time datetime="2012-08-10T09:56:00-04:00" pubdate data-updated="true">Aug 10<span>th</span>, 2012</time>
</p>
</header>
<div class="entry-content"><p>Deface is a gem to make targeted changes to views without altering the source
file. It was developed by the Spree core team to help when multiple engines
attempt to override the same view file.</p>
<p>Slides from my talk at the <a href="http://www.meetup.com/dcruby/">DC Ruby Users Group</a> on Aug. 9, 2012.</p>
<script async class="speakerdeck-embed" data-id="5025067408de81000204ef0d"
data-ratio="1.299492385786802"
src="//speakerdeck.com/assets/embed.js"></script>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/05/17/serving-additional-assets-on-the-pipeline/">Serving Additional Assets on the Pipeline</a></h1>
<p class="meta">
<time datetime="2012-05-17T09:12:00-04:00" pubdate data-updated="true">May 17<span>th</span>, 2012</time>
</p>
</header>
<div class="entry-content"><h1>What is the problem?</h1>
<p>Javascript and Stylesheet files required in application.js/css are not directly
accessable in production. This is hard to detect during development because
all assets are accessable through /assets/{name} in development mode.</p>
<p>The Rails Golden Path expects all javascript and stylesheet files to be
declared in application.js/css. They are compiled together and minified
in production. Once they are compiled together in production, the individual
files are not directly accessable through /assets/{name}.</p>
<p>There are a couple situations where this causes problems. If you include a
3rd party javascript library that includes additional files, they may be
accessable in development, but quietly fail in production.</p>
<p>We were using redactor.js which has 4 support files. It uses javascript
to include the supporting files. We updated the declarations to /assets/en.js,
/assets/pages.js etc. This worked fine in development. Redactor could access
/assets/pages.js but in production when it was trying to request
/assets/pages.js was returning 404.</p>
<p>We required pages.js at the top of application.js. It was getting compiled
together with the rest of the javascripts, but Redactor quietly failed when
it couldn&#8217;t access /assets/pages.js.</p>
<h1>Why did this happen?</h1>
<p>Rails assumes you will declare all your javascript and stylesheets in application.js/css.
It also assumes in development that you want to access all the files directly through
/assets/{name}. But once all the files are compiled to the /public/assets/application.js,
you don&#8217;t need direct access to the individal files. The direct access we enjoyed in development
is no longer available.</p>
<p>In production, some configuration options are set to improve performance:</p>
<pre><code># Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
</code></pre>
<p>The last line says that if a file isn&#8217;t found in /public/assets don&#8217;t look in the
project asset directories to find it. This is true in development.
Any file burried in an assets directory can be found.</p>
<p>When you deploy to production, &#8216;rake assets:precompile&#8217; is run. All the files declared
in application.js will be compiled and minified into a single file in /public/assets. But
the individual files will not be copied into /public/assets.</p>
<h1>How do you fix it?</h1>
<p>While you are in development mode, you can run &#8216;rake assets:precompile&#8217;. Then inspect
your public/assets directory to see which files are copied over. If a specific file is
not there; it will not be available in production.</p>
<p>If you need a specific file compiled and accessable from public/assets you need to
declare it in &#8216;config/enviroments/production.rb&#8217;:</p>
<pre><code># Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( myfile.js )
</code></pre>
<p>If you need a javascript or stylesheet file to be directly accessable from public/assets, then you must
add it to the array passed to <strong>config.assets.precompile</strong>. Once you add it, you can run
&#8216;rake assets:precompile&#8217; again to verify the file is copied over.</p>
<p>The trick is that the files are directly accessable in development mode so config.assets.precompile
is not used. But without explictly declaring them in production.rb, they will not be available once you&#8217;ve
deployed to production.</p>
<p>Stay on the Golden Path.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/05/11/hemisu-theme-for-vim-and-terminal/">Hemisu Theme for Vim and Terminal</a></h1>
<p class="meta">
<time datetime="2012-05-11T08:08:00-04:00" pubdate data-updated="true">May 11<span>th</span>, 2012</time>
</p>
</header>
<div class="entry-content"><p>There is a new theme in town. Move over solarized. Make room for Hemisu.
This has become my new vim and terminal theme for daily coding. I tried
to use solarized; but I couldn&#8217;t fall in love.</p>
<p>Noah Frederick has created this amazing theme for Vim and Mac Terminal.
It includes light and dark variations. I prefer the dark background unless
I get stuck by the window at Starbucks. Then it is a simple &#8220;set background=light&#8221;.</p>
<ul>
<li><a href="http://noahfrederick.com/vim-color-scheme-hemisu">Hemisu Vim Theme</a></li>
<li><a href="http://noahfrederick.com/vim-color-scheme-hemisu">Hemisu Mac Terminal Theme</a></li>
</ul>
<p><img src="/images/hemisu.png" alt="hemisu preview" /></p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/03/13/url-reconstruction-in-rails/">Url Reconstruction in Rails</a></h1>
<p class="meta">
<time datetime="2012-03-13T10:50:00-04:00" pubdate data-updated="true">Mar 13<span>th</span>, 2012</time>
</p>
</header>
<div class="entry-content"><h2>Problem</h2>
<p>In Rails, I needed to take the request url and redirect the user to a new host with additional query parameters while passing the original path and query parameters.</p>
<p>For example, if the original request looked like:</p>
<pre><code>"http://www.mystore.com/cart?sort=desc"
</code></pre>
<p>I needed to redirect them to:</p>
<pre><code>"https://mobile.mystore.com/cart?sort=desc&amp;view=ipad"
</code></pre>
<p>While this could be done with fancy string manipulation, I figured there had to be a cleaner and less error prone way.</p>
<h2>Solution</h2>
<p>There is a great utility in <a href="http://www.ruby-doc.org/stdlib-1.9.3/libdoc/uri/rdoc/Kernel.html#method-c-URI">Ruby Core</a> to handle URL manipulation. Unfortunately, it isn&#8217;t well documented.</p>
<p>There is a kernal level method named URI which parses the full url and breaks it down into parts</p>
<pre><code># request.url = http://www.mystore.com/cart?sort=desc
uri = URI(request.url)
puts uri.host # www.mystore.com
puts uri.scheme # http
puts uri.query # sort=desc
</code></pre>
<p>To swap the host and scheme was easy enough</p>
<pre><code>uri.host = "mobile.mystore.com"
uri.scheme = "https"
</code></pre>
<p>To modify the query parameters, we had to consider the possiblity of no parameters. In that case, the uri.query would be nil. The query parameters are only broken down into a string, so we have to split, add and join them back together.</p>
<pre><code>query = uri.query ? uri.query.split('&amp;') : []
query &lt;&lt; "view=ipad"
uri.query = query.join('&amp;')
</code></pre>
<p>Then we just have to reconstruct the url and redirect the user</p>
<pre><code>redirect_to uri.to_s # https://mobile.mystore.com/cart?sort=desc&amp;view=ipad
</code></pre>
<h2>Conclusion</h2>
<p>There is always a cleaner way.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/03/06/spree-product-groups-removed/">Spree Product Groups Removed</a></h1>
<p class="meta">
<time datetime="2012-03-06T09:56:00-05:00" pubdate data-updated="true">Mar 6<span>th</span>, 2012</time>
</p>
</header>
<div class="entry-content"><p>We have removed Product Groups from the core Spree project. This was a rarely used feature; but, the code was fairly complex. In an effort to keep Spree lean, the code was extracted and moved to an <a href="https://github.com/spree/spree_product_groups">extension</a>.</p>
<p>The commit to <a href="https://github.com/spree/spree/commit/b0e1b664f4dc87efeb54333e4cfe7802d0d9ebfc">Spree Master</a> will be part of the 1.1 release. If you are using Product Group functionality, then you&#8217;ll want to include the extension in your Gemfile after &#8216;spree&#8217;.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">gem</span> <span class="s1">&#39;spree&#39;</span>
</span><span class='line'><span class="n">gem</span> <span class="s1">&#39;spree_product_groups&#39;</span><span class="p">,</span> <span class="ss">:git</span> <span class="o">=&gt;</span> <span class="s1">&#39;git@github.com:spree/spree_product_groups.git&#39;</span>
</span></code></pre></td></tr></table></div></figure>
<p>It has not been released as a gem, so you&#8217;ll have to declare it with a reference to the git repository.</p>
<p>All previous Product Group functionality will be restored by the extension.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/03/01/call-super-in-method-missing/">Call Super in Method_missing</a></h1>
<p class="meta">
<time datetime="2012-03-01T14:07:00-05:00" pubdate data-updated="true">Mar 1<span>st</span>, 2012</time>
</p>
</header>
<div class="entry-content"><p>Recently, I was refactoring some code and came across this seemingly innocuous method_missing override:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">def</span> <span class="nf">method_missing</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
</span><span class='line'> <span class="vi">@properties</span><span class="o">[</span><span class="nb">name</span><span class="o">]</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<p>I&#8217;ve seen this <strong>quick</strong> hack more often then I&#8217;d prefer. It allows easy reader access to the values stored in the hash.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1">#instead of this</span>
</span><span class='line'><span class="n">object</span><span class="o">.</span><span class="n">properties</span><span class="o">[</span><span class="ss">:keywords</span><span class="o">]</span>
</span><span class='line'>
</span><span class='line'><span class="c1">#you can call this</span>
</span><span class='line'><span class="n">object</span><span class="o">.</span><span class="n">keywords</span>
</span></code></pre></td></tr></table></div></figure>
<p>The <em>keywords</em> method is not found; so, method_missing is called. The missing method name is passed to the hash and the value is returned. But if the key does not exsist, then nil is returned. The side effect is that any method name can be called on the object and nil is returned. Even inncorect method names will happily return nil. This can propogate misspelled method names throughout the code.</p>
<p>Overriding method_missing is a great way to quickly add convenient reader methods to your object. But method_missing has an important job. By not calling super, your changing the assumed behavior native to ruby. Misspelled method names or methods which do not exist should raise an exception. This is the expected behavior.</p>
<p>The correct way to override method_missing is to check if the key exists; otherwise call super.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">def</span> <span class="nf">method_missing</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
</span><span class='line'> <span class="k">if</span> <span class="vi">@properties</span><span class="o">.</span><span class="n">has_key?</span> <span class="nb">name</span>
</span><span class='line'> <span class="vi">@properties</span><span class="o">[</span><span class="nb">name</span><span class="o">]</span>
</span><span class='line'> <span class="k">else</span>
</span><span class='line'> <span class="k">super</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/02/28/debugging-spree-1-dot-0-with-ruby-1-dot-9-3/">Debugging Spree 1.0 With Ruby 1.9.3</a></h1>
<p class="meta">
<time datetime="2012-02-28T07:17:00-05:00" pubdate data-updated="true">Feb 28<span>th</span>, 2012</time>
</p>
</header>
<div class="entry-content"><p>Here are the steps you need to get ruby-debug to work with Ruby 1.9.3p125 in the Spree sandbox.</p>
<h2>Setup</h2>
<ul>
<li>rvm 1.10.3</li>
<li>ruby 1.9.3p125</li>
<li>Spree 1.0.x</li>
</ul>
<h2>Installing Gems</h2>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1"># download the source code for pre-release version of linecache, then install locally</span>
</span><span class='line'><span class="n">curl</span> <span class="o">-</span><span class="no">OL</span> <span class="n">http</span><span class="ss">:/</span><span class="o">/</span><span class="n">rubyforge</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">frs</span><span class="o">/</span><span class="n">download</span><span class="o">.</span><span class="n">php</span><span class="o">/</span><span class="mi">75414</span><span class="o">/</span><span class="n">linecache19</span><span class="o">-</span><span class="mi">0</span><span class="o">.</span><span class="mi">5</span><span class="o">.</span><span class="mi">13</span><span class="o">.</span><span class="n">gem</span>
</span><span class='line'><span class="n">gem</span> <span class="n">install</span> <span class="n">linecache19</span><span class="o">-</span><span class="mi">0</span><span class="o">.</span><span class="mi">5</span><span class="o">.</span><span class="mi">13</span><span class="o">.</span><span class="n">gem</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># download the source code for pre-release version of debug-base, then install locally</span>
</span><span class='line'><span class="c1"># using rvm installed source code (/Users/cmar/.rvm/rubies/ruby-1.9.3-p125/rubies/src)</span>
</span><span class='line'><span class="n">curl</span> <span class="o">-</span><span class="no">OL</span> <span class="n">http</span><span class="ss">:/</span><span class="o">/</span><span class="n">rubyforge</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">frs</span><span class="o">/</span><span class="n">download</span><span class="o">.</span><span class="n">php</span><span class="o">/</span><span class="mi">75415</span><span class="o">/</span><span class="n">ruby</span><span class="o">-</span><span class="n">debug</span><span class="o">-</span><span class="n">base19</span><span class="o">-</span><span class="mi">0</span><span class="o">.</span><span class="mi">11</span><span class="o">.</span><span class="mi">26</span><span class="o">.</span><span class="n">gem</span>
</span><span class='line'><span class="n">gem</span> <span class="n">install</span> <span class="n">ruby</span><span class="o">-</span><span class="n">debug</span><span class="o">-</span><span class="n">base19</span><span class="o">-</span><span class="mi">0</span><span class="o">.</span><span class="mi">11</span><span class="o">.</span><span class="mi">26</span><span class="o">.</span><span class="n">gem</span> <span class="o">--</span> <span class="o">--</span><span class="n">with</span><span class="o">-</span><span class="n">ruby</span><span class="o">-</span><span class="kp">include</span><span class="o">=</span><span class="s2">&quot;${MY_RUBY_HOME/rubies/src}&quot;</span>
</span></code></pre></td></tr></table></div></figure>
<h2>Modify Spree Gemfile</h2>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">group</span> <span class="ss">:development</span> <span class="k">do</span>
</span><span class='line'> <span class="err"> </span> <span class="n">gem</span> <span class="s1">&#39;linecache19&#39;</span><span class="p">,</span> <span class="s1">&#39;0.5.13&#39;</span>
</span><span class='line'> <span class="err"> </span> <span class="n">gem</span> <span class="s1">&#39;ruby-debug-base19&#39;</span><span class="p">,</span> <span class="s1">&#39;0.11.26&#39;</span>
</span><span class='line'> <span class="err"> </span> <span class="n">gem</span> <span class="s1">&#39;ruby-debug19&#39;</span><span class="p">,</span> <span class="ss">:require</span> <span class="o">=&gt;</span> <span class="s1">&#39;ruby-debug&#39;</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<h2>Running Spree Sandbox</h2>
<p>After you update the Spree gemfile, you can create a sandbox and run with the debugger</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">git</span> <span class="nb">clone</span> <span class="n">https</span><span class="ss">:/</span><span class="o">/</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">spree</span><span class="o">/</span><span class="n">spree</span>
</span><span class='line'><span class="n">cd</span> <span class="n">spree</span>
</span><span class='line'><span class="c1"># edit Gemfiile (above)</span>
</span><span class='line'><span class="n">bundle</span>
</span><span class='line'><span class="n">bundle</span> <span class="nb">exec</span> <span class="n">rake</span> <span class="n">sandbox</span>
</span><span class='line'><span class="n">cd</span> <span class="n">sandbox</span>
</span><span class='line'><span class="n">rails</span> <span class="n">s</span> <span class="o">--</span><span class="n">debugger</span>
</span></code></pre></td></tr></table></div></figure>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/02/22/slides-from-spreeconf-2012-nyc/">Slides From SpreeConf 2012 NYC</a></h1>
<p class="meta">
<time datetime="2012-02-22T07:32:00-05:00" pubdate data-updated="true">Feb 22<span>nd</span>, 2012</time>
</p>
</header>
<div class="entry-content"><p>Here are the slides from my talk at SpreeConf 2012 in New York City. I covered the new Preferences for Spree 1.0 and their usages in payments and promotions. I went pretty deep with a lot of interaction diagrams.</p>
<script src="http://speakerdeck.com/embed/4f40db32156b230022009e13.js"></script>
<p><a href="https://github.com/cmar/spree_conf_pref_demo">Demo Source Code on Github</a></p>
</div>
</article>
<div class="pagination">
<a href="/blog/archives">Blog Archives</a>
</div>
</div>
<aside class="sidebar">
<section>
<script src="//about.me/embed/cmar"></script>
</section>
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/2013/06/08/fun-with-shipments-at-spreeconfdc/">Fun with Shipments at SpreeConfDC</a>
</li>
<li class="post">
<a href="/blog/2013/03/18/bundle-searching/">bundle searching</a>
</li>
<li class="post">
<a href="/blog/2012/08/10/defacing-your-views/">Defacing Your Views</a>
</li>
<li class="post">
<a href="/blog/2012/05/17/serving-additional-assets-on-the-pipeline/">Serving Additional Assets on the Pipeline</a>
</li>
<li class="post">
<a href="/blog/2012/05/11/hemisu-theme-for-vim-and-terminal/">Hemisu Theme for Vim and Terminal</a>
</li>
</ul>
</section>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li class="loading">Status updating&#8230;</li>
</ul>
<a href="https://github.com/cmar">@cmar</a> on GitHub
<script type="text/javascript">
$.domReady(function(){
if (!window.jXHR){
var jxhr = document.createElement('script');
jxhr.type = 'text/javascript';
jxhr.src = '/javascripts/libs/jXHR.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(jxhr, s);
}
github.showRepos({
user: 'cmar',
count: 0,
skip_forks: true,
target: '#gh_repos'
});
});
</script>
<script src="/javascripts/github.js" type="text/javascript"> </script>
</section>
<section>
<h1>Latest Tweets</h1>
<ul id="tweets">
<li class="loading">Status updating&#8230;</li>
</ul>
<script type="text/javascript">
$.domReady(function(){
getTwitterFeed("cmar", 4, false);
});
</script>
<script src="/javascripts/twitter.js" type="text/javascript"> </script>
<a href="http://twitter.com/cmar" class="twitter-follow-button" data-show-count="false">Follow @cmar</a>
</section>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
Copyright &copy; 2013 - Chris Mar -
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
</p>
</footer>
<script type="text/javascript">
var disqus_shortname = 'cmarblog';
var disqus_script = 'count.js';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
<script type="text/javascript">
(function(){
var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true;
twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})();
</script>
</body>
</html>