<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -41,20 +41,6 @@ end
 
 template do
 
-# Twitter app registation
-if twitter_auth
-  # requires: 
-  # * sudo gem install twitter (need drnic version with register_oauth command)
-  # * twitter install
-  # * twitter add
-  twitter_users = `twitter list | grep &quot;^[* ] &quot; | sed -e &quot;s/[* ] //&quot;`.split
-  twitter_user = highline.choose(*twitter_users) do |menu|
-    menu.prompt = &quot;Which twitter user?  &quot;
-  end
-  message = run &quot;twitter register_oauth #{twitter_user} '#{app_name}' http://#{app_url} '#{description}' organization='#{organization}' organization_url=http://#{domain}&quot;
-  twitter_auth_keys = parse_keys(message)
-end
-
 # select slice + add CNAME
 
 # github private repo + add self as collaborator if != github user
@@ -207,6 +193,19 @@ end
   file 'app/views/protected/index.html.erb', '&lt;h3&gt;&lt;%= current_user.login %&gt;&lt;/h3&gt;'
   
   if twitter_auth
+    # Twitter app registation
+
+    # requires: 
+    # * sudo gem install twitter (need drnic version with register_oauth command)
+    # * twitter install
+    # * twitter add
+    twitter_users = `twitter list | grep &quot;^[* ] &quot; | sed -e &quot;s/[* ] //&quot;`.split
+    twitter_user = highline.choose(*twitter_users) do |menu|
+      menu.prompt = &quot;Which twitter user?  &quot;
+    end
+    message = run &quot;twitter register_oauth #{twitter_user} '#{app_name}' http://#{app_url} '#{description}' organization='#{organization}' organization_url=http://#{domain}&quot;
+    twitter_auth_keys = parse_keys(message)
+
     append_file 'config/environments/development.rb', &quot;\n\nOpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE\n&quot;
     append_file 'config/environments/test.rb', &quot;\n\nOpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE\n&quot;
     
@@ -268,18 +267,12 @@ end
   #  $ git remote add origin git@github.com:mocra/#{app_name}.git
   #  $ git push origin master
   #
-  # Create DNS entry for slicehost slice:
-  #  $ slicehost-dns add_cname #{domain} #{app_url} slice-name
-  #
   # After you can log into remote machine (cap deploy:setup)
   #  $ ssh #{app_url} -A
   #  # ssh git@github.com
   #  =&gt; 'yes'
   #  Hi drnic! You've successfully authenticated, but GitHub does not provide shell access.
   #
-  # twitter_auth
-  # * register twitter app http://twitter.com/oauth_clients
-  # * copy keys into twitter_auth.yml
   
   require 'deprec'
 
@@ -337,6 +330,14 @@ end
   git :add =&gt; '.'
   git :commit =&gt; &quot;-a -m 'Plugins and config'&quot;
 
+# Setup slicehost slice
+
+  slices = slices_name_and_ip
+  slice_name = highline.choose(slices.keys.sort) do |menu|
+    menu.prompt = &quot;Install application on which slice?  &quot;
+  end
+  run &quot;slicehost-dns add_cname #{domain} #{app_name} #{slice_name}&quot;
+
   if twitter_auth
     log &quot;The next step is to edit config/twitter_auth.yml to reflect our OAuth client key and secret (to register your application log in to Twitter and visit http://twitter.com/oauth_clients).&quot;
     # `open http://intridea.com/2009/3/23/twitter-auth-for-near-instant-twitter-apps`</diff>
      <filename>mocra.rb</filename>
    </modified>
    <modified>
      <diff>@@ -43,7 +43,7 @@ describe &quot;template_runner&quot; do
     end
     describe &quot;run template&quot; do
       before(:each) do
-        @runner.highline.should_receive(:choose).and_return(&quot;drnic&quot;)
+        @runner.highline.should_receive(:choose).twice.and_return(&quot;drnic&quot;, &quot;mocra-primary&quot;)
         @runner.on_command(:run, &quot;twitter register_oauth drnic 'rails-templates' http://rails-templates.mocra.com 'This is a cool app' organization='Mocra' organization_url=http://mocra.com&quot;) do
           &lt;&lt;-EOS.gsub(/^          /, '')
           Nice! You've registered your application successfully.
@@ -51,6 +51,11 @@ describe &quot;template_runner&quot; do
           Consumer secret: CONSUMERSECRET
           EOS
         end
+        @runner.should_receive(:slices_name_and_ip).ordered.and_return({
+          'mocra-primary' =&gt; '123.123.123.123',
+          'mocra-secondary' =&gt; '65.65.65.65'
+        })
+
         @runner.run_template
         @log = @runner.full_log
       end
@@ -60,6 +65,7 @@ describe &quot;template_runner&quot; do
       it { @runner.files['config/twitter_auth.yml'].should_not be_nil }
       it { @runner.files['config/twitter_auth.yml'].should =~ %r{oauth_consumer_key: CONSUMERKEY} }
       it { @runner.files['config/twitter_auth.yml'].should =~ %r{oauth_consumer_secret: CONSUMERSECRET} }
+      it { @log.should =~ %r{executing  slicehost-dns add_cname mocra.com rails-templates mocra-primary}}
     end
   end
 end</diff>
      <filename>mocra/spec/twitter_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>64d00bd839079eac84ac3b6532a16e92cbc5d483</id>
    </parent>
  </parents>
  <author>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </author>
  <url>http://github.com/sethbc/rails-templates/commit/5f8a354027b1a4faadfd48cfa36d62cc7586515f</url>
  <id>5f8a354027b1a4faadfd48cfa36d62cc7586515f</id>
  <committed-date>2009-04-05T09:35:46-07:00</committed-date>
  <authored-date>2009-03-27T21:42:41-07:00</authored-date>
  <message>slicehost gem used to list, select and assign cname for main zone

Signed-off-by: Seth Chandler &lt;sethbc@sethbc.org&gt;</message>
  <tree>e5cf07c3f4d9ac4446b8ff03f2c7006353f7f4c6</tree>
  <committer>
    <name>Seth Chandler</name>
    <email>sethbc@sethbc.org</email>
  </committer>
</commit>
