<?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>Tactical Agility &#187; Ruby</title>
	<atom:link href="http://patrickpeak.com/wordpress/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://patrickpeak.com/wordpress</link>
	<description>Software Development, Rails and Content Management</description>
	<lastBuildDate>Tue, 05 Jan 2010 16:46:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Incoming: BrowserCMS commandline script</title>
		<link>http://patrickpeak.com/wordpress/2010/01/incoming-browsercms-commandline-script/</link>
		<comments>http://patrickpeak.com/wordpress/2010/01/incoming-browsercms-commandline-script/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 15:02:19 +0000</pubDate>
		<dc:creator>peakpg</dc:creator>
				<category><![CDATA[BrowserCMS]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://patrickpeak.com/wordpress/?p=23</guid>
		<description><![CDATA[In 3.1, it should be a bit easier to create a new BrowserCMS project. The new gem will come with a command line script which should simplify the syntax associated with project creation. Here&#8217;s how it works.
Old 3.0 style
Instead of writing this somewhat ungainly command:
rails my_project -m http://browsercms.org/templates/blank.rb
New 3.1 style
You will be able to type:
browsercms [...]]]></description>
			<content:encoded><![CDATA[<p>In 3.1, it should be a bit easier to create a new BrowserCMS project. The new gem will come with a command line script which should simplify the syntax associated with project creation. Here&#8217;s how it works.</p>
<p><strong>Old 3.0 style</strong><br />
Instead of writing this somewhat ungainly command:</p>
<p><code>rails my_project -m http://browsercms.org/templates/blank.rb</code></p>
<p><strong>New 3.1 style</strong><br />
You will be able to type:</p>
<p><code>browsercms my_project</code></p>
<p>This will create a blank BrowserCMS project, just like the first script. It&#8217;s basically just a simplifying wrapper around the <tt>rails</tt> command.</p>
<p><strong>For the very lazy (like me)</strong><br />
And if ten characters is really just too much to type for you, the following will work as well.</p>
<p><code>bcms my_project</code></p>
<p><strong>Modules, Demo and rails options</strong><br />
In most cases, developers want to create blank projects, which is what the <tt>browsercms</tt> command does. The two next most common use cases are:</p>
<ul>
<li>Creating a demo project (which contains some more detailed sample templates and data) </li>
<li>Creating a module (which creates a skeleton for a packagable BrowserCMS module). </li>
</ul>
<p>In addition, the majority of the rail&#8217;s commandline options are still available (like -d and &#8211;force), so you can still pass the same options in. Here&#8217;s some examples:</p>
<p><strong>Demos for the new folks</strong></p>
<p><code>browsercms demo_site -m demo</code></p>
<p>This creates the project using the demo application template. What we have done is overload the application template option (-m) to allow a short hand version (demo) rather than have to specify the full path. </p>
<p><strong>Creating a module</strong><br />
The same is also true for creating modules, like so:</p>
<p><code>browsercms bcms_fancy_module -m module -d mysql --freeze</code></p>
<p>This creates a module project. Here we show off how the standard rails options work, so this project will use mysql database and freeze Rails into the vendor/rails directory, via the <tt>-d</tt> and <tt>--freeze</tt> options.</p>
<p><strong>Get some help</strong><br />
You can run <tt>browsercms</tt> to get help on what options the command supports.</p>
<p><strong>Benefits of having a script</strong><br />
There are few reasons why we decided to add the new script, starting with the most obvious:</p>
<ul>
<li><em>It&#8217;s shorter to type and easier to remember:</em> Even I had to look the exact syntax for the 3.0 command, so a worst this change is about my bad memory.</li>
<li><em>We can provide help/documentation:</em> By having a script, we can make things more discoverable for new developers as well as provide examples/options for returning users.</li>
<li><em>Removes the external dependancy on browsercms.org:</em> By creating a script, we can look up and use the blank.rb template from within the gem, rather than needing to download it from the browsercms.org website</li>
<li><em>Handle multiple versions of templates:</em> One major problem with the 3.0 syntax is that we couldn&#8217;t make changes to say, blank.rb, without breaking backwards compatibility. All versions of browsercms were using the same template file. By using the templates packaging with each gem, we avoid the need for silly workarounds.</li>
</ul>
<p>Requiring developers to remember which version of a template to use would be asking for trouble. The following would certainly have worked, but is needlessly complicated.</p>
<p><code>rails my_project -m http://browsercms.org/template/3.0.4/blank.rb</code></p>
<p><strong>In Conclusion</strong><br />
So that&#8217;s the new command line script that will be available for 3.1. It&#8217;s available current in the master branch on <a href="http://github.com/browsermedia/browsercms/tree">github</a> for folks to play around with. Over the next few weeks, I plan to add more articles here about upcoming features and changes from 3.1, so stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickpeak.com/wordpress/2010/01/incoming-browsercms-commandline-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
