<?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; Doc Ritezel</title>
	<atom:link href="http://pivotallabs.com/author/eritezel/feed/" rel="self" type="application/rss+xml" />
	<link>http://pivotallabs.com</link>
	<description>Agility Developed</description>
	<lastBuildDate>Sun, 19 May 2013 18:22:15 +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>Using the Style Guide gem</title>
		<link>http://pivotallabs.com/using-style-guide-gem/</link>
		<comments>http://pivotallabs.com/using-style-guide-gem/#comments</comments>
		<pubDate>Mon, 21 Jan 2013 13:00:08 +0000</pubDate>
		<dc:creator>Doc Ritezel</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=11670</guid>
		<description><![CDATA[<p>Much like any good Rails engine, using Style Guide is designed to give you as much flexibility as possible. In its default state, Style Guide renders subdirectories full of partials located under app/views/style-guide. You might be wondering what to do next. Let&#8217;s walk through iterating on a partial. Setting Up the Partial $ mkdir -p app/views/style-guide/branding $ mkdir -p app/assets/stylesheets/branding Now we&#8217;ve got a place for our partials and stylesheets to live. Let&#8217;s make a partial for the company&#8217;s name: # app/views/style-guide/branding/_headers.html &#60;h1 class="brand-name"&#62;The Company You Trust&#60;/h1&#62; Now we can style them using some SCSS. I heard you like hot pink: # app/assets/stylesheets/branding/headers.css.scss .brand-name { color: #f0f; background-color: black; font-weight: 900; } Fantastic! It&#8217;s like the mid-90s in here. Iteration in the Style Guide At this point, Style Guide is ready for iterating until the header is properly-styled. Let&#8217;s change the colors around as a stand-in for your actual tweaking process.&#8230;</p><p>The post <a href="http://pivotallabs.com/using-style-guide-gem/">Using the Style Guide gem</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Much like any good Rails engine, using Style Guide is designed to give you as much flexibility as possible.  In its default state, Style Guide renders subdirectories full of partials located under <code>app/views/style-guide</code>.</p>
<p>You might be wondering what to do next.  Let&#8217;s walk through iterating on a partial.<br />
<span id="more-11670"></span></p>
<h2>Setting Up the Partial</h2>
<pre><code class="bash">$ mkdir -p app/views/style-guide/branding
$ mkdir -p app/assets/stylesheets/branding
</code></pre>
<p>Now we&#8217;ve got a place for our partials and stylesheets to live.  Let&#8217;s make a partial for the company&#8217;s name:</p>
<pre><code class="html"># app/views/style-guide/branding/_headers.html
&lt;h1 class="brand-name"&gt;The Company You Trust&lt;/h1&gt;
</code></pre>
<p>Now we can style them using some SCSS.  I heard you like hot pink:</p>
<pre><code class="scss"># app/assets/stylesheets/branding/headers.css.scss
.brand-name {
  color: #f0f;
  background-color: black;
  font-weight: 900;
}
</code></pre>
<p>Fantastic!  It&#8217;s like the mid-90s in here.</p>
<h2>Iteration in the Style Guide</h2>
<p>At this point, Style Guide is ready for iterating until the header is properly-styled.  Let&#8217;s change the colors around as a stand-in for your actual tweaking process.</p>
<pre><code class="scss"># app/assets/stylesheets/branding/headers.css.scss
.brand-name {
  color: #0096D6;
  font-weight: 900;
}
</code></pre>
<p>Compared to turning on all the pink pixels in your computer&#8217;s screen, that blue is a lot nicer to look at.</p>
<h2>Laying Out Partials</h2>
<p>A quick note for the sharp-witted: resist the temptation to do full-page layouts inside of Style Guide.  Not only does putting layout inside Style Guide pollute the visual elements being styled, it complicates any future refactoring or extraction you might do.  Layout nomenclature, an extremely complex issue, is best decided per project.</p>
<p>Let&#8217;s say we want to put both headers on the landing page, which will in this case be the &#8220;index&#8221; action of our &#8220;home&#8221; controller.</p>
<pre><code class="html"># app/views/home/index.html
&lt;h1&gt;Brand Name Company&lt;/h1&gt;
</code></pre>
<p>Let&#8217;s say we&#8217;re very clever and put the controller and action name onto the body as CSS classes.</p>
<pre><code class="erb"># app/views/layouts/application.html.erb
...
&lt;body class="&lt;%= controller.controller_name %&gt; &lt;%= controller.action_name %&gt;"&gt;
...
</code></pre>
<p>We&#8217;re going to do something very clever with SASS in &lt;code class=&quot;app/assets/stylesheets/home.css.scss</code>
<pre>"&gt; that will make your head spin:

<pre><code class="scss"># app/assets/stylesheets/home.css.scss
.home.index {
  h1 {
    @extend .brand-header;
  }
}
</code></pre>
<p>This uses <code>@extend</code> to reduce CSS duplication.  All of a sudden, the rules in <code>.brand-name</code> that we styled are applied to <code>.home.index h1</code>.  Here's what the compiled version of <code>headers.css.scss</code> will look like:</p>
<pre><code class="css">.brand-name,
.home.index h1 {
  color: #0096D6;
  font-weight: 900;
}
</code></pre>
<p>Superficially, <code>@extend</code> lets us see all the places where the <code>.brand-name</code> class is applied.  Structurally, and more importantly, <code>@extend</code> separates the implementation of a widget's styling from its layout.</p>
<p>We could have gotten the same structural result with <code>include</code>, but that would have resulted in code duplication.  Likewise, we could have put <code>.brand-name</code> onto the <code>&lt;h1&gt;</code>, but that would be a stronger coupling.</p>
<h2>Multiple States for Partials</h2>
<p>Due to an unfortunate Superbowl ad, we need to change the company name's color when the mouse hovers over it.  Due to how browser's work, we can't fake the <code>:hover</code> selector, so we need to make a CSS class to represent the hovered state.  Let's add that to the <code>branding/headers.html</code> partial.</p>
<pre><code class="html"># app/views/style-guide/branding/_headers.html
&lt;h1 class="brand-name"&gt;The Company You Trust&lt;/h1&gt;
&lt;h1 class="brand-name brand-name-hover"&gt;Trust No One&lt;/h1&gt;
</code></pre>
<p>Now we need to style this.</p>
<pre><code class="scss"># app/assets/stylesheets/branding/headers.css.scss
.brand-name {
  color: #0096D6;
  font-weight: 900;
}
.brand-name-hover {
  color: #D9541E;
}
</code></pre>
<p>Okay, so now both states are styled.  Let's apply the hover style to that <code>&lt;h1&gt;</code>element to complete the story:</p>
<pre><code class="scss"># app/assets/stylesheets/home.css.scss
.home.index {
  h1 {
    @extend .brand-name;
    &amp;:hover {
      @extend .brand-name-hover
    }
  }
}
</code></pre>
<p>Wow, now that's some contrast!</p>
<h2>Configuring the Style Guide Location</h2>
<p>This whole time, we've been putting our files into <code>app/views/style-guide</code>, but this isentirely configurable.  Just pop open your <code>application.rb</code> and change the <code>config.style_guide</code> line.  Let's say you want to put your guide in <code>app/guide</code> instead:</p>
<pre><code class="ruby">class YourApplication &lt; Rails::Application
  ...
  config.style_guide.paths &lt;&lt; Rails.root.join("app", "guide")
  ...
end
</code></pre>
<p>Now you're configuring Style Guide like a champ!</p>
<p>The post <a href="http://pivotallabs.com/using-style-guide-gem/">Using the Style Guide gem</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/using-style-guide-gem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing the Style Guide gem</title>
		<link>http://pivotallabs.com/style-guide-gem/</link>
		<comments>http://pivotallabs.com/style-guide-gem/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 13:00:32 +0000</pubDate>
		<dc:creator>Doc Ritezel</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=11651</guid>
		<description><![CDATA[<p>Your Rails application has a unit test suite in RSpec, a set of request specs using Capybara, and a Jasmine suite for your JavaScript. You may even have Cucumber so that your PM can participate in automated testing definition. According to long-standing traditions in Rails testing, your ass is covered. You have a CSS-shaped hole in your test coverage. You need a style guide. Today, you can quickly set one up on your Rails application with the style-guide gem. Poor CSS Hygiene is Technical Debt Here at Pivotal Labs, we&#8217;ve run into this conundrum more than once. In the life of a Rails app, more and more pages get added, supported by more and more CSS, and hacks plug more and more holes in the layout. With every commit, even if your Ruby is good looking, you risk adding technical debt. According to Nicole Sullivan, massively large sites like Facebook&#8230;</p><p>The post <a href="http://pivotallabs.com/style-guide-gem/">Introducing the Style Guide gem</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Your Rails application has a unit test suite in RSpec, a set of request specs using Capybara, and a Jasmine suite for your JavaScript. You may even have Cucumber so that your PM can participate in automated testing definition. According to long-standing traditions in Rails testing, your ass is covered.</p>
<p>You have a CSS-shaped hole in your test coverage. You need a style guide. Today, you can quickly set one up on your Rails application with the <a href="https://github.com/pivotalexperimental/style-guide">style-guide gem</a>.<br />
<span id="more-11651"></span></p>
<h1>Poor CSS Hygiene is Technical Debt</h1>
<p>Here at Pivotal Labs, we&#8217;ve run into this conundrum more than once. In the life of a Rails app, more and more pages get added, supported by more and more CSS, and hacks plug more and more holes in the layout. With every commit, even if your Ruby is good looking, you risk adding technical debt.</p>
<p>According to Nicole Sullivan, massively large sites like Facebook and LinkedIn run into the same issues. At one point, Facebook famously defined its blue color an astonishing 260 times more than it should have been. Not only does CSS get larger and more complex as time goes on, the act of paying down that technical debt usually involves acts of heroism.</p>
<p>In short, maintaining CSS on large projects has become a mostly-joyless cross-browser fiasco, desperately in need of tooling.</p>
<h1>Testing the Visual Medium</h1>
<p>Over the last few years, Pivotal Labs has sometimes extended the test suite metaphor to the visual elements of a Rails application.  In most cases, this is a single page containing the most important visual elements. However, this strategy has existed largely as informal community knowledge.</p>
<p>In unit test suites, the major functions of a block of code are tested against controlled input.  When tests written before implementation, <a href="http://en.wikipedia.org/wiki/Loose_coupling">loose coupling</a> and decreased complexity are generally the result. Styling elements in a style guide first can have the same benefits.</p>
<p>As well as being a good system design tool, a unit test suite can also be considered a form of documentation.  Tests describe the behavior of all the code in a system, often exposing the failure cases and exceptions that can happen during execution.  A style guide serves the same purpose for new developers joining a team, efficiently describing all the widgets and states in a site.</p>
<p>As Pivotal Labs grows in size and builds out its design team, the style guide also serves as a communication device between designers and developers. On several projects, the style guide serves as a single point of reference for product owners, developers and designers to talk about their application&#8217;s visual elements.</p>
<h1>Installing the Style Guide gem</h1>
<p>The <code>style-guide</code> Rails engine mounts onto your Rails application at <code>/style-guide</code> by default and renders files out of subdirectories underneath <code>app/views/style-guide</code>.</p>
<p><code>style-guide</code> also ships with a bunch of Twitter Bootstrap elements by default, which can easily be hidden.</p>
<p>Add the following line to your Gemfile:</p>
<pre><code class="ruby">gem "style-guide"</code></pre>
<p>Use Bundler to install it:</p>
<pre><code class="bash">$ bundle install</code></pre>
<p>Use the Rails generator to set up your project the rest of the way:</p>
<pre><code class="bash">$ rails generator style_guide:install</code></pre>
<p>Start Rails and Guard (in their own terminals of course):</p>
<pre><code class="bash">$ rails server
$ bundle exec guard</code></pre>
<p>You&#8217;re ready to visit Style Guide in its new home, most likely at http://localhost:3000/style-guide.</p>
<p>Stay tuned for part 2: Using Style Guide in your Workflow.</p>
<p>The post <a href="http://pivotallabs.com/style-guide-gem/">Introducing the Style Guide gem</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/style-guide-gem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Naked Gemspec</title>
		<link>http://pivotallabs.com/the-naked-gemspec/</link>
		<comments>http://pivotallabs.com/the-naked-gemspec/#comments</comments>
		<pubDate>Fri, 14 Dec 2012 19:42:00 +0000</pubDate>
		<dc:creator>Doc Ritezel</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[bbq]]></category>
		<category><![CDATA[fiasco]]></category>
		<category><![CDATA[gems]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/the-naked-gemspec/</guid>
		<description><![CDATA[<p><p>Before we start, the <code>.gemspec</code> itself only appears once.  Here it is, as generated by <code>bundle init</code> and hand-tweaked for relevance:</p>

<pre><code>lib = File.expand_path&#40;"../lib", __FILE__&#41;
$LOAD_PATH.unshift&#40;lib&#41; unless $LOAD_PATH.include?&#40;lib&#41;
require "your_gem/version"

Gem::Specification.new do &#124;s&#124;
  s.name        = "your-gem"
  s.version     = YourGem::VERSION
  s.authors     = ["Your Name"]
  s.email       = ["you@example.com"]
  s.homepage    = "https://github.com/you/should-use-github"
  s.summary     = "Describe this gem like you're talking to me."
  s.description = "Describe this gem like you're talking to your mom."

  s.require_paths = ["lib"]
  s.files         = `git ls-files`.split&#40;"n"&#41;
  s.test_files    = `git ls-files -- spec/*`.split&#40;"n"&#41;

  s.add_dependency "hashie", "~&#62; 2.0"
  s.add_development_dependency "rspec", "~&#62; 2.12"
end
</code></pre>

<p>But what does all this mean?  Moreover, how do all these crazy bits fit together?</p> <a href="http://pivotallabs.com/the-naked-gemspec/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/the-naked-gemspec/">The Naked Gemspec</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Before we start, the <code>.gemspec</code> itself only appears once.  Here it is, as generated by <code>bundle init</code> and hand-tweaked for relevance:</p>
<pre><code>lib = File.expand_path&#40;"../lib", __FILE__&#41;
$LOAD_PATH.unshift&#40;lib&#41; unless $LOAD_PATH.include?&#40;lib&#41;
require "your_gem/version"

Gem::Specification.new do |s|
  s.name        = "your-gem"
  s.version     = YourGem::VERSION
  s.authors     = ["Your Name"]
  s.email       = ["you@example.com"]
  s.homepage    = "https://github.com/you/should-use-github"
  s.summary     = "Describe this gem like you're talking to me."
  s.description = "Describe this gem like you're talking to your mom."

  s.require_paths = ["lib"]
  s.files         = `git ls-files`.split&#40;"n"&#41;
  s.test_files    = `git ls-files -- spec/*`.split&#40;"n"&#41;

  s.add_dependency "hashie", "~&gt; 2.0"
  s.add_development_dependency "rspec", "~&gt; 2.12"
end
</code></pre>
<p>But what does all this mean?  Moreover, how do all these crazy bits fit together?</p>
<h2>Files</h2>
<p>The most important component of any gemspec is the list of files that it includes when building the gem.  After all, a <code>.gem</code> file is just a tarball with a metadata header written in Ruby.  Here&#8217;s how we make that happen:</p>
<pre><code>s.files         = ['file/one', 'file/two']
s.test_files    = ['spec/one', 'spec/two']
</code></pre>
<p>Let&#8217;s exploit part of <code>git</code> to give us the list of files.  Don&#8217;t use <code>git</code> on your project?  Start using <code>git</code>.  Problem solved!  Here&#8217;s what it gives us:</p>
<pre><code>$ git ls-files
.gitignore
.rvmrc
Gemfile
LICENSE
README.md
your-gem.gemspec
lib/your_gem.rb
lib/your_gem/version.rb
spec/lib/your_gem.rb
spec/spec_helper.rb
</code></pre>
<p>We can make this output into a Ruby array of strings quite simply:</p>
<pre><code>`git ls-files`.split&#40;"n"&#41;
</code></pre>
<p>Now, gems are laid out in a conventional way.  That means a <code>lib</code> directory, a <code>spec</code> directory and some predictable files.  That means nobody has to guess where your files are, which is fantastic!</p>
<p>Now let&#8217;s say you want to exclude your .rvmrc and .gitignore, because those files aren&#8217;t really all that important:</p>
<pre><code>`git ls-files`.split&#40;"n"&#41; - %w&#40;.rvmrc .gitignore&#41;
</code></pre>
<p>Note: exclude <code>Gemfile.lock</code> from git, even though it might exist in your directory.  This is conventional.</p>
<h2>Naming</h2>
<p>Your gem&#8217;s classes are called YourGem, while they live in files named <code>your_gem</code>.  As a matter of taste, I believe gems should be named <code>your-gem</code>.  There&#8217;s an argument to be made that gem names should match their requires &#40;i.e., the gem should be named <code>your_gem</code>&#41;.</p>
<h2>Version</h2>
<p>The first component here is the version number for your gem.  In this example, the <code>your_gem/version.rb</code> looks like this:</p>
<pre><code>module YourGem
  VERSION = "0.1.0"
end
</code></pre>
<p>This is a <a href="http://semver.org/">Semantic Versioning</a> string, and it&#8217;s the Simplest Thing that Could Possibly Work for a version.</p>
<h2>Dependencies</h2>
<p>This is the fun part.  I&#8217;m of the opinion that dependencies should be as loose as possible until they&#8217;re not, but that throwing them away by doing <code>&gt;= 0</code> is the wrong approach.</p>
<p>For example, the above file will pull in RSpec as a dependency, but require any version that matches a pattern like <code>2.y.z</code>, as long as <code>y</code> is above 12.  Note that <code>z</code> is allowed to be anything, which allows patch versions to be included.</p>
<p>Of course, this means that everyone in the community has to play along and not break their gem on a minor version bump.  Also, the community now includes you!</p>
<h2>Maintenance</h2>
<p>So now you&#8217;ve got a conventional gem with loosely-required dependencies.  How do you know if these change?  Well, if you&#8217;re on github, you can use <a href="https://gemnasium.com">Gemnasium</a> to watch for new dependency versions and see if anything&#8217;s broken!</p>
<p>Dropping a new version of your gem is as easy as <code>gem release</code> with <a href="https://twitter.com/svenfuchs">@svenfuchs</a>&#8216;s <a href="https://github.com/svenfuchs/gem-release">gem-release</a> gem.</p>
<h2>More Reading</h2>
<ul>
<li><a href="http://guides.rubygems.org/patterns">Rubygems Patterns</a></li>
<li><a href="http://semver.org">Semantic Versioning</a></li>
<li><a href="http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile">Clarifying the Roles of the gem spec and Gemfile</a></li>
<li><a href="http://robots.thoughtbot.com/post/2508037841/rubys-pessimistic-operator">The Pessimistic Gem Version Operator</a></li>
</ul>
<p>The post <a href="http://pivotallabs.com/the-naked-gemspec/">The Naked Gemspec</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/the-naked-gemspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated Deployment Messages</title>
		<link>http://pivotallabs.com/automated-deployment-messages/</link>
		<comments>http://pivotallabs.com/automated-deployment-messages/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 20:15:00 +0000</pubDate>
		<dc:creator>Doc Ritezel</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[autotagger]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/automated-deployment-messages/</guid>
		<description><![CDATA[<p><h2>Make deployment visible with Capistrano, Autotagger, Git and Sendgrid</h2>

<p>There comes a time in every project when the deployment process comes of age, and that development arrives with its own set of Capistrano recipes and Rake tasks.  The project I'm on hit that point recently, and one of the neat outcomes of its nascent puberty was a simple Capistrano recipe to send a git changelog to our project mailing list.</p>

<p>Here's what this looks like:</p>

<pre><code>$ cap staging deploy
... stuff happens here ...
  * executing `sendgrid:notify'
Changelog:
04fc6dd adding capistrano deployment messages
</code></pre> <a href="http://pivotallabs.com/automated-deployment-messages/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/automated-deployment-messages/">Automated Deployment Messages</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Make deployment visible with Capistrano, Autotagger, Git and Sendgrid</h2>
<p>There comes a time in every project when the deployment process comes of age, and that development arrives with its own set of Capistrano recipes and Rake tasks.  The project I&#8217;m on hit that point recently, and one of the neat outcomes of its nascent puberty was a simple Capistrano recipe to send a git changelog to our project mailing list.</p>
<p>Here&#8217;s what this looks like:</p>
<pre><code>$ cap staging deploy
... stuff happens here ...
  * executing `sendgrid:notify'
Changelog:
04fc6dd adding capistrano deployment messages
</code></pre>
<p>To use this in your Rails project, the first thing you need is a sendgrid account. If you&#8217;re budget-minded, you can always use the credentials your Heroku app is using.</p>
<pre><code>$ heroku create
Creating heroku-wackiness-90210... done, stack is cedar
http://heroku-wackiness-90210.herokuapp.com/ | git@heroku.com:heroku-wackiness-90210.git
Git remote heroku added
$ heroku addons:add sendgrid:starter
Adding sendgrid:starter on heroku-wackiness-90210... done, v2 &#40;free&#41;
Use `heroku addons:docs sendgrid:starter` to view documentation.
$ heroku config -s
SENDGRID_PASSWORD=s3kr17
SENDGRID_USERNAME=yodawg@heroku.com
</code></pre>
<p>This process uses Capistrano and Autotagger.  For information on setting up Capistrano, their <a href="https://github.com/capistrano/capistrano/wiki/2.x-Getting-Started">wiki</a> is an excellent starting point.  For Autotagger setup with Capistrano, Jeff Dean&#8217;s <a href="https://github.com/zilkey/auto_tagger">auto_tagger</a> repository is the canonical source of information.</p>
<p>After you&#8217;re up and running with Capistrano and Autotagger, you need to add the following file under <code>lib/recipes/sendgrid_notifier.rb</code>:</p>
<pre><code>require 'mail'

set :sendgrid_user, "whatever"
set :sendgrid_password, "secret"
set :sendgrid_domain, "pivotallabs.com"

set :sender, "Now Hiring &lt;jobs@pivotallabs.com&gt;"
set :recipient, "Steve Squivot &lt;you@square.com&gt;"

namespace :sendgrid do
  task :notify do
    sendgrid = {
      :address   =&gt; "smtp.sendgrid.net",
      :port      =&gt; 587,
      :domain    =&gt; sendgrid_domain,
      :user_name =&gt; sendgrid_user,
      :password  =&gt; sendgrid_password,
      :authentication =&gt; 'plain',
      :enable_starttls_auto =&gt; true
    }

    auto_tagger = AutoTagger::CapistranoHelper.new&#40;
      :stage =&gt; rails_env,
      :stages =&gt; auto_tagger_stages&#41;.auto_tagger
    previous_sha = auto_tagger.refs_for_stage&#40;stage&#41;.last.sha
    current_sha = auto_tagger.repo.latest_commit_sha

    mail = Mail.new&#40;from: recipient, to: sender&#41;
    mail.delivery_method :smtp, sendgrid
    mail.subject = "[#{stage}] New Deployment!"
    mail.body = `git log --oneline #{previous_sha}..#{current_sha}`
    mail.deliver!
  end
end
</code></pre>
<p>Then, let&#8217;s add a line to include this recipe in our Capfile:</p>
<pre><code>require File.expand_path&#40;"../lib/recipes/sendgrid_notifier.rb", __FILE__&#41;
</code></pre>
<p>Finally, let&#8217;s try it out:</p>
<pre><code>$ cap ci sendgrid:notify
  * executing `sendgrid:notify'
Changelog:
04fc6dd add a recruiter message to send off to Square
</code></pre>
<p>Alright! The email&#8217;s on its way. If you need to call this in your custom deployment step, it&#8217;s as easy as sticking <code>sendgrid.notify</code> into your <code>Capfile</code>.</p>
<p>Happy deploying!</p>
<p>The post <a href="http://pivotallabs.com/automated-deployment-messages/">Automated Deployment Messages</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/automated-deployment-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Standup][SF] 09/12/12: The Milkshake Fiasco</title>
		<link>http://pivotallabs.com/standup-sf-09-12-12-the-milkshake-fiasco/</link>
		<comments>http://pivotallabs.com/standup-sf-09-12-12-the-milkshake-fiasco/#comments</comments>
		<pubDate>Wed, 12 Sep 2012 14:51:00 +0000</pubDate>
		<dc:creator>Doc Ritezel</dc:creator>
				<category><![CDATA[Standup]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[fiasco]]></category>
		<category><![CDATA[milkshake]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/standup-sf-09-12-12-the-milkshake-fiasco/</guid>
		<description><![CDATA[<p><h2>Events</h2>

<ul>
<li><p>Chocolate Milkshake Day was announced but not substantiated.</p>

<p>The SF office is now in breathless anticipation of chocolate milkshakes.</p></li>
</ul> <a href="http://pivotallabs.com/standup-sf-09-12-12-the-milkshake-fiasco/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/standup-sf-09-12-12-the-milkshake-fiasco/">[Standup][SF] 09/12/12: The Milkshake Fiasco</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Events</h2>
<ul>
<li>
<p>Chocolate Milkshake Day was announced but not substantiated.</p>
<p>The SF office is now in breathless anticipation of chocolate milkshakes.</p>
</li>
</ul>
<p>The post <a href="http://pivotallabs.com/standup-sf-09-12-12-the-milkshake-fiasco/">[Standup][SF] 09/12/12: The Milkshake Fiasco</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/standup-sf-09-12-12-the-milkshake-fiasco/feed/</wfw:commentRss>
		<slash:comments>0</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 using apc
Object Caching 732/789 objects using apc

 Served from: pivotallabs.com @ 2013-05-19 21:31:58 by W3 Total Cache -->