<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pivotal Labs &#187; paperclip</title>
	<atom:link href="http://pivotallabs.com/tag/paperclip/feed/" rel="self" type="application/rss+xml" />
	<link>http://pivotallabs.com</link>
	<description>Agility Developed</description>
	<lastBuildDate>Wed, 19 Jun 2013 22:16:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>SF Standup for Monday, 4/25/2011:  What gem do you use for file upload?</title>
		<link>http://pivotallabs.com/sf-standup-for-monday-4-25-2011-what-gem-do-you-use-for-file-upload/</link>
		<comments>http://pivotallabs.com/sf-standup-for-monday-4-25-2011-what-gem-do-you-use-for-file-upload/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 14:17:00 +0000</pubDate>
		<dc:creator>Pivotal Labs</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[pry]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/sf-standup-for-monday-4-25-2011-what-gem-do-you-use-for-file-upload/</guid>
		<description><![CDATA[<p><h2>Help</h2>

<blockquote>
    <p><strong>What are projects using for file upload? <a href="https://github.com/thoughtbot/paperclip">Paperclip</a>?</strong>
    <strong><a href="https://github.com/jnicklas/carrierwave">Carrierwave</a>?</strong></p>
</blockquote>

<p>Most continue to use Paperclip, though a few projects have
successfully used Carrierwave. Carrierwave apparently has better <a href="http://www.mongodb.org/">mongo</a> support.</p>

<blockquote>
    <p><strong>I tried to setup ruby and rails, and installed the latest</strong>
    <strong>mysql gem and I get warning messages about the mysql gem.</strong></p>
</blockquote>

<p>Others have experienced this too and offered to help. The main answer
seemed to be "the warnings are lies, it will work."</p>

<h2>Interesting</h2>

<ul>
<li>Checkout <a href="https://github.com/banister/pry">Pry</a>. It's an irb replacement that includes tab
completion and cd and ls for navigating scopes.</li>
</ul> <a href="http://pivotallabs.com/sf-standup-for-monday-4-25-2011-what-gem-do-you-use-for-file-upload/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/sf-standup-for-monday-4-25-2011-what-gem-do-you-use-for-file-upload/">SF Standup for Monday, 4/25/2011:  What gem do you use for file upload?</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Help</h2>
<blockquote>
<p><strong>What are projects using for file upload? <a href="https://github.com/thoughtbot/paperclip">Paperclip</a>?</strong><br />
    <strong><a href="https://github.com/jnicklas/carrierwave">Carrierwave</a>?</strong></p>
</blockquote>
<p>Most continue to use Paperclip, though a few projects have<br />
successfully used Carrierwave. Carrierwave apparently has better <a href="http://www.mongodb.org/">mongo</a> support.</p>
<blockquote>
<p><strong>I tried to setup ruby and rails, and installed the latest</strong><br />
    <strong>mysql gem and I get warning messages about the mysql gem.</strong></p>
</blockquote>
<p>Others have experienced this too and offered to help. The main answer<br />
seemed to be &#8220;the warnings are lies, it will work.&#8221;</p>
<h2>Interesting</h2>
<ul>
<li>Checkout <a href="https://github.com/banister/pry">Pry</a>. It&#8217;s an irb replacement that includes tab<br />
completion and cd and ls for navigating scopes.</li>
</ul>
<p>The post <a href="http://pivotallabs.com/sf-standup-for-monday-4-25-2011-what-gem-do-you-use-for-file-upload/">SF Standup for Monday, 4/25/2011:  What gem do you use for file upload?</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/sf-standup-for-monday-4-25-2011-what-gem-do-you-use-for-file-upload/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Election Day Standup, 06/08/2010</title>
		<link>http://pivotallabs.com/election-day-standup-06-08-2010/</link>
		<comments>http://pivotallabs.com/election-day-standup-06-08-2010/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 14:31:00 +0000</pubDate>
		<dc:creator>Mike Grafton</dc:creator>
				<category><![CDATA[Standup]]></category>
		<category><![CDATA[amazon cloudfront]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[paperclip]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/election-day-standup-06-08-2010/</guid>
		<description><![CDATA[<p><h1>Help</h1>

<blockquote>
    <p>How do I migrate paperclip attachments from one model to another?</p>
</blockquote>

<p>A Pivot wants to do his civic duty of <a href="http://c2.com/cgi/wiki?EmbraceChange">embracing change</a>. This means refactoring his domain model to suit the emerging requirements of his product team. Unfortunately, this also means he has to move a <a href="http://github.com/thoughtbot/paperclip">paperclip</a> attachment from one model to another. Paperclip does not appear to have a built in way to do this. </p>

<p>The opinion of the group was to use the brute-force solution: write some code to do the migration yourself.  If you are using Amazon S3 for storage &#40;which this project is&#41;, you can do an S3 'cp' command to move the assets from one path to another. At the end, you can use the rake command 'paperclip:refresh:thumbnails' to re-generate the thumbnails.</p>

<p>If you want to do this by hand, <a href="http://cyberduck.ch/">cyberduck</a> has a nice interface for batch re-naming of files on S3.</p>

<h1>Interesting</h1>

<blockquote>
    <p>Amazon CloudFront now supports HTTPS</p>
</blockquote>

<p>They also dropped their prices.</p>

<blockquote>
    <p>IE has a limit of 31 CSS files. </p>
</blockquote>

<p>This has bitten many Pivots over the years. Your 32nd &#40;and up&#41; CSS file will be silently ignored.</p> <a href="http://pivotallabs.com/election-day-standup-06-08-2010/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/election-day-standup-06-08-2010/">Election Day Standup, 06/08/2010</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h1>Help</h1>
<blockquote>
<p>How do I migrate paperclip attachments from one model to another?</p>
</blockquote>
<p>A Pivot wants to do his civic duty of <a href="http://c2.com/cgi/wiki?EmbraceChange">embracing change</a>. This means refactoring his domain model to suit the emerging requirements of his product team. Unfortunately, this also means he has to move a <a href="http://github.com/thoughtbot/paperclip">paperclip</a> attachment from one model to another. Paperclip does not appear to have a built in way to do this. </p>
<p>The opinion of the group was to use the brute-force solution: write some code to do the migration yourself.  If you are using Amazon S3 for storage &#40;which this project is&#41;, you can do an S3 &#8216;cp&#8217; command to move the assets from one path to another. At the end, you can use the rake command &#8216;paperclip:refresh:thumbnails&#8217; to re-generate the thumbnails.</p>
<p>If you want to do this by hand, <a href="http://cyberduck.ch/">cyberduck</a> has a nice interface for batch re-naming of files on S3.</p>
<h1>Interesting</h1>
<blockquote>
<p>Amazon CloudFront now supports HTTPS</p>
</blockquote>
<p>They also dropped their prices.</p>
<blockquote>
<p>IE has a limit of 31 CSS files. </p>
</blockquote>
<p>This has bitten many Pivots over the years. Your 32nd &#40;and up&#41; CSS file will be silently ignored.</p>
<p>The post <a href="http://pivotallabs.com/election-day-standup-06-08-2010/">Election Day Standup, 06/08/2010</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/election-day-standup-06-08-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stubbing out Paperclip/ImageMagick in Tests</title>
		<link>http://pivotallabs.com/stubbing-out-paperclip-imagemagick-in-tests/</link>
		<comments>http://pivotallabs.com/stubbing-out-paperclip-imagemagick-in-tests/#comments</comments>
		<pubDate>Wed, 19 May 2010 06:14:00 +0000</pubDate>
		<dc:creator>Pivotal Labs</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/stubbing-out-paperclip-imagemagick-in-tests/</guid>
		<description><![CDATA[<p><p><a href="http://ruby-toolbox.com/categories/rails_file_uploads.html">Many people</a> use the ultra popular <a href="http://github.com/thoughtbot/paperclip">Paperclip library</a> to handle file attachments in Rails. Unfortunately the Paperclip documentation does not cover how to stub out calls to ImageMagick in your test suite. Without the proper stubs in place a test suite that uses Paperclip will take much, much longer to run.</p>

<p>In the <a href="http://grease-your-suite.heroku.com/">grease your suite presentation</a> by Nick Gauthier it has a slide titled <em>Quickerclip</em> that describes what needs to be done to spend up Paperclip in tests, basically you need to keep it from shelling out to ImageMagick. Alas, the presentation does include code for how to achieve <em>Quickerclip</em>. </p>

<p>As the presentation shows Paperclip.run is the method that needs to be changed. The first parameter passed to Paperclip.run is the ImageMagick command be executed. Paperclip uses the identify and convert commands. The <code>identify</code> command is used to determine the dimensions of an image. The <code>convert</code> command is the really heavy one that does image manipulation and thumbnail generation. Here is a redefinition of Paperclip.run with sensible behavior for tests.</p>

<pre><code>module Paperclip
  def self.run cmd, params = "", expected_outcodes = 0
    case cmd
    when "identify"
      return "100x100"
    when "convert"
      return
    else
      super
    end
  end
end

class Paperclip::Attachment
  def post_process
  end
end
</code></pre>

<p>Redefining <code>post_process</code> in Paperclip::Attachment is an optional additional optimization. In Paperclip, <code>post_process</code> eventually calls <code>Paperclip.run&#40;"convert"&#41;</code> and by short-circuiting the method earlier in the chain we save a few cycles.</p> <a href="http://pivotallabs.com/stubbing-out-paperclip-imagemagick-in-tests/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/stubbing-out-paperclip-imagemagick-in-tests/">Stubbing out Paperclip/ImageMagick in Tests</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://ruby-toolbox.com/categories/rails_file_uploads.html">Many people</a> use the ultra popular <a href="http://github.com/thoughtbot/paperclip">Paperclip library</a> to handle file attachments in Rails. Unfortunately the Paperclip documentation does not cover how to stub out calls to ImageMagick in your test suite. Without the proper stubs in place a test suite that uses Paperclip will take much, much longer to run.</p>
<p>In the <a href="http://grease-your-suite.heroku.com/">grease your suite presentation</a> by Nick Gauthier it has a slide titled <em>Quickerclip</em> that describes what needs to be done to spend up Paperclip in tests, basically you need to keep it from shelling out to ImageMagick. Alas, the presentation does include code for how to achieve <em>Quickerclip</em>. </p>
<p>As the presentation shows Paperclip.run is the method that needs to be changed. The first parameter passed to Paperclip.run is the ImageMagick command be executed. Paperclip uses the identify and convert commands. The <code>identify</code> command is used to determine the dimensions of an image. The <code>convert</code> command is the really heavy one that does image manipulation and thumbnail generation. Here is a redefinition of Paperclip.run with sensible behavior for tests.</p>
<pre><code>module Paperclip
  def self.run cmd, params = "", expected_outcodes = 0
    case cmd
    when "identify"
      return "100x100"
    when "convert"
      return
    else
      super
    end
  end
end

class Paperclip::Attachment
  def post_process
  end
end
</code></pre>
<p>Redefining <code>post_process</code> in Paperclip::Attachment is an optional additional optimization. In Paperclip, <code>post_process</code> eventually calls <code>Paperclip.run&#40;"convert"&#41;</code> and by short-circuiting the method earlier in the chain we save a few cycles.</p>
<p>The post <a href="http://pivotallabs.com/stubbing-out-paperclip-imagemagick-in-tests/">Stubbing out Paperclip/ImageMagick in Tests</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/stubbing-out-paperclip-imagemagick-in-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using apc
Database Caching 1/10 queries in 0.006 seconds using apc
Object Caching 573/604 objects using apc

 Served from: pivotallabs.com @ 2013-06-20 07:43:35 by W3 Total Cache -->