Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

temporarily removing website whilst moving to gh-pages branch

  • Loading branch information...
commit 8785fe1fa02b49efcb7742cfceef121fc6877b14 1 parent 9c597f5
@drnic authored
View
268 website/index.html
@@ -1,268 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>
- rubigen
- </title>
- <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
-<style>
-</style>
- <script type="text/javascript">
- window.onload = function() {
- settings = {
- tl: { radius: 10 },
- tr: { radius: 10 },
- bl: { radius: 10 },
- br: { radius: 10 },
- antiAlias: true,
- autoPad: true,
- validTags: ["div"]
- }
- var versionBox = new curvyCorners(settings, document.getElementById("version"));
- versionBox.applyCornersToAll();
-
- var twitterBox = new curvyCorners(settings, document.getElementById("twitter_search"));
- twitterBox.applyCornersToAll();
- }
- </script>
-</head>
-<body>
-<div id="main">
- <h1>rubigen</h1>
- <div class="sidebar">
- <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/rubigen"; return false'>
- <p>Get Version</p>
- <a href="http://rubyforge.org/projects/rubigen" class="numbers">1.5.0</a>
- </div>
-
- <div id="twitter_search">
- <h3>Heard on twitter ('rubigen')...</h3>
- <!-- HELP FILE - http://twitterwidget.jazzychad.com/tw/ -->
- <script language = "javascript">
- var jtw_search = 'rubigen';
- var jtw_widget_background = 'd77';
- var jtw_widget_border = '0';
- var jtw_tweet_textcolor = 'fff';
- var jtw_tweet_background = '000';
- var jtw_tweet_border = '0px';
- </script>
- <script src="http://twitterwidget.jazzychad.com/tw/searchwidget.js" type="text/javascript"></script>
- </div>
-
- </div>
- <h1>Ruby Generator Framework</h1>
-<h2>What</h2>
-<p>A framework to allow Ruby applications to generate file/folder stubs (like the <code>rails</code> command does for Ruby on Rails, and the &#8216;script/generate&#8217; command within a Rails application during development).</p>
-<p>The RubyConf 2007 presentation is now <a href="http://rubyconf2007.confreaks.com/d3t1p1_rubigen.html">online</a> together with the theme from the A-Team.</p>
-<h2>Background</h2>
-<p>RubiGen is originally extracted from Ruby on Rails (specifically the rails_generator from its railties gem).</p>
-<p>The rails_generator was hardcoded with Rails-specific dependencies (<code>RAILS_ROOT</code>), Rails generators (&#8216;app&#8217; = Rails application; &#8216;model&#8217; = Rails model+tests+migration), and generally assumed it was the only generator framework within the Ruby world (it was). So, any RubyGem whose name ended with &#8216;_generator&#8217; was assumed to be a generator for a Rails application.</p>
-<p>But if you are developing an Adhearsion application, then you may want a different set of generators.<br />
-If you are developing a RubyGem, then you will want a different set of generators.</p>
-<p>RubiGen exists to give different development environments their own generator framework.</p>
-<h2>Installing</h2>
-<p>RubiGen is only required at development time, and normally isn&#8217;t required at deployment time (unless your application uses it to generate files etc for its users).</p>
-<p>On your development machine:</p>
-<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">rubigen</span></pre></p>
-<h2>Usage</h2>
-<p>RubiGen will be normally integrated into another RubyGem, such as <code>newgem</code> or <code>merb</code> or <code>camping</code>, rather than be used on its own.</p>
-<p>These frameworks might use RubiGen for two reasons:</p>
-<ol>
- <li>To generate an initial stub for developers, e.g. <code>rails</code> generated a stub to write a Rails application. <code>newgem</code> generates a stub to write a RubyGem. <br/><br />
- <span class="caps">BTW</span> &#8211; RubiGen has a builtin application <code>ruby_app</code> which generates a bare-bones Ruby application stub (lib, test, and script folders, plus a Rakefile, and a script/generate script)</li>
- <li>To generate components within their development areas, e.g. Rails had its <code>script/generate</code> script within each Rails application, which hooked back into the rails_generator to lookup and execute generators.</li>
-</ol>
-<p>So, there are two steps to integrating RubiGen into your framework:</p>
-<ol>
- <li>Use it to generate an initial stub for the developers of your framework. This would create the folders <br />
- (<code>lib/app</code>, <code>test</code>, <code>script</code>, <code>doc</code>, <code>log</code>, etc) and starting files (<code>Rakefile</code>, <br />
- <code>README.txt</code>, <code>test/test_helper.rb</code> etc). Importantly, it would generate a <code>script/generate</code> file.<br />
- The <code>script/generate</code> file (example below) will allow developers of your framework to <br />
- generate components/extensions within the framework. <br /><br />
- RubiGen allows you to restrict which generators are available. For example, within<br />
- RubyGem development environment (as generated by <code>newgem</code>), the <code>script/generator</code><br />
- only shows <code>rubygem</code>-related generators. Rails could restrict <code>script/generator</code><br />
- to only show Rails related generators</li>
- <li>Your framework RubyGem (e.g. <code>newgem</code> or <code>merb</code> RubyGems) needs to add <code>rubigen</code> as a <br />
- dependency, so that users of your RubyGem can access the generator framework.</li>
-</ol>
-<h1>Creating generators</h1>
-<p>There are two types of generators:</p>
-<ol>
- <li>Application Generators &#8211; used by developers of your framework to get started. <br />
- Generally, you will create one Application Generator for your framework.<br />
- It generates a base stub (such as the <code>rails</code> stub for new Rails applications)<br />
- for your framework users.</li>
- <li>Component Generators &#8211; used by developers to extend their application.<br />
- You may include 1+ built-in generators with your framework.<br />
- Developers can also write generators for your framework, and like Rails&#8217; generator<br />
- install them in various places and have access to their via RubiGen.</li>
-</ol>
-<h2>Creating an Application Generator for your Framework</h2>
-<h3>Easy way</h3>
-<p><a href="http://newgem.rubyforge.org/">newgem</a> (v0.13.0+) can generate an Application Generator<br />
-for a RubyGem.</p>
-<ol>
- <li>Create new RubyGem: <code>newgem foobar</code></li>
- <li>Create generator: <code>script/generator application_generator foobar</code></li>
- <li>Update tests + generator</li>
- <li>Install</li>
- <li>Run with: foobar</li>
-</ol>
-<p>For more documentation, run <code>script/generator application_generator</code></p>
-<h3><span class="caps">DIY</span></h3>
-<p>Without RubiGen, to give your users a head start and create a stub for them, you will <br />
-copiously use <code>mkdir_p</code> and <code>File.open</code>. Your script will either be primitive (only<br />
-create the bare folders and very few files) or it will be very long and unreadable<br />
-(ok, perhaps I&#8217;m just talking about the <code>newgem</code> script, which I am dubiously responsible<br />
-for&#8230; :P).</p>
-<p>With RubiGen, you can create stubs using powerful, yet simple, syntax. Templates are<br />
-extracted into a <code>templates</code> folder, and activating the generator from a script requires<br />
-only a few lines of code.</p>
-<p>These are the <code>newgem</code> files related to its Application Generator.</p>
-bin/
-bin/newgem # Appliction Generator script; Usage: newgem gemname [options]
-app_generators/
-app_generators/newgem/
-app_generators/newgem/newgem_generator.rb
-app_generators/newgem/<span class="caps">USAGE</span>
-app_generators/newgem/templates/
-app_generators/newgem/templates/app.rb
-app_generators/newgem/templates/History.txt
-app_generators/newgem/templates/&#8230; lots and lots of templates
-<p>The <code>bin/newgem</code> script is very simple, and looks like:</p>
-<p><pre class='syntax'>
-<span class="ident">require</span> <span class="punct">'</span><span class="string">rubygems</span><span class="punct">'</span>
-<span class="ident">require</span> <span class="punct">'</span><span class="string">rubigen</span><span class="punct">'</span>
-
-<span class="keyword">if</span> <span class="punct">%w(</span><span class="string">-v --version</span><span class="punct">).</span><span class="ident">include?</span> <span class="constant">ARGV</span><span class="punct">.</span><span class="ident">first</span>
- <span class="ident">require</span> <span class="punct">'</span><span class="string">newgem/version</span><span class="punct">'</span>
- <span class="ident">puts</span> <span class="punct">&quot;</span><span class="string"><span class="expr">#{File.basename($0)}</span> <span class="expr">#{Newgem::VERSION}</span></span><span class="punct">&quot;</span>
- <span class="ident">exit</span><span class="punct">(</span><span class="number">0</span><span class="punct">)</span>
-<span class="keyword">end</span>
-
-<span class="ident">require</span> <span class="punct">'</span><span class="string">rubigen/scripts/generate</span><span class="punct">'</span>
-<span class="constant">RubiGen</span><span class="punct">::</span><span class="constant">Base</span><span class="punct">.</span><span class="ident">use_application_sources!</span>
-<span class="constant">RubiGen</span><span class="punct">::</span><span class="constant">Scripts</span><span class="punct">::</span><span class="constant">Generate</span><span class="punct">.</span><span class="ident">new</span><span class="punct">.</span><span class="ident">run</span><span class="punct">(</span><span class="constant">ARGV</span><span class="punct">,</span> <span class="symbol">:generator</span> <span class="punct">=&gt;</span> <span class="punct">'</span><span class="string">newgem</span><span class="punct">')</span>
-</pre></p>
-<p>You can copy and paste this for your own generator script, and place it in your RubyGem&#8217;s <code>bin</code> folder.<br />
-Change <code>newgem</code> to your RubyGem&#8217;s name in the script above (and in all the folders listed above too)</p>
-<p><span class="caps">NOTE</span>: If you leave <code>newgem</code> there, then it will execute the <code>newgem_generator.rb</code> generator; <br />
-as the generators are loaded from all RubyGem&#8217;s having <code>/app_generators</code> folders.</p>
-<p>So, for your RubyGem, you need to keep the <code>/app_generators</code> folder (as you are creating an <br />
-Application Generator, not a Component Generator), but change <code>newgem</code> to <code>your gem name</code> in<br />
-all the subfolders and files. <span class="caps">ESPECIALLY</span> <code>newgem_generator.rb</code> &#8594; <code>yourgem_generator.rb</code>,<br />
-as this is how the generator is discovered (via <code>RubiGen::Base.use_application_sources!</code>).</p>
-<p>All the generator work is performed within <code>yourgem_generator.rb</code>. A stub for it will be:</p>
-<p><pre class='syntax'>
-<span class="ident">require</span> <span class="punct">'</span><span class="string">rbconfig</span><span class="punct">'</span>
-
-<span class="keyword">class </span><span class="class">YourgemGenerator</span> <span class="punct">&lt;</span> <span class="constant">RubiGen</span><span class="punct">::</span><span class="constant">Base</span>
- <span class="constant">DEFAULT_SHEBANG</span> <span class="punct">=</span> <span class="constant">File</span><span class="punct">.</span><span class="ident">join</span><span class="punct">(</span><span class="constant">Config</span><span class="punct">::</span><span class="constant">CONFIG</span><span class="punct">['</span><span class="string">bindir</span><span class="punct">'],</span>
- <span class="constant">Config</span><span class="punct">::</span><span class="constant">CONFIG</span><span class="punct">['</span><span class="string">ruby_install_name</span><span class="punct">'])</span>
-
- <span class="ident">default_options</span> <span class="symbol">:shebang</span> <span class="punct">=&gt;</span> <span class="constant">DEFAULT_SHEBANG</span><span class="punct">,</span>
- <span class="symbol">:an_option</span> <span class="punct">=&gt;</span> <span class="punct">'</span><span class="string">some_default</span><span class="punct">'</span>
-
- <span class="ident">attr_reader</span> <span class="symbol">:app_name</span><span class="punct">,</span> <span class="symbol">:module_name</span>
-
- <span class="keyword">def </span><span class="method">initialize</span><span class="punct">(</span><span class="ident">runtime_args</span><span class="punct">,</span> <span class="ident">runtime_options</span> <span class="punct">=</span> <span class="punct">{})</span>
- <span class="keyword">super</span>
- <span class="ident">usage</span> <span class="keyword">if</span> <span class="ident">args</span><span class="punct">.</span><span class="ident">empty?</span>
- <span class="attribute">@destination_root</span> <span class="punct">=</span> <span class="ident">args</span><span class="punct">.</span><span class="ident">shift</span>
- <span class="attribute">@app_name</span> <span class="punct">=</span> <span class="constant">File</span><span class="punct">.</span><span class="ident">basename</span><span class="punct">(</span><span class="constant">File</span><span class="punct">.</span><span class="ident">expand_path</span><span class="punct">(</span><span class="attribute">@destination_root</span><span class="punct">))</span>
- <span class="attribute">@module_name</span> <span class="punct">=</span> <span class="ident">app_name</span><span class="punct">.</span><span class="ident">camelize</span>
- <span class="ident">extract_options</span>
- <span class="keyword">end</span>
-
- <span class="keyword">def </span><span class="method">manifest</span>
- <span class="comment"># Use /usr/bin/env if no special shebang was specified</span>
- <span class="ident">script_options</span> <span class="punct">=</span> <span class="punct">{</span> <span class="symbol">:chmod</span> <span class="punct">=&gt;</span> <span class="number">0755</span><span class="punct">,</span> <span class="symbol">:shebang</span> <span class="punct">=&gt;</span> <span class="ident">options</span><span class="punct">[</span><span class="symbol">:shebang</span><span class="punct">]</span> <span class="punct">==</span> <span class="constant">DEFAULT_SHEBANG</span> <span class="punct">?</span> <span class="constant">nil</span> <span class="punct">:</span> <span class="ident">options</span><span class="punct">[</span><span class="symbol">:shebang</span><span class="punct">]</span> <span class="punct">}</span>
- <span class="ident">windows</span> <span class="punct">=</span> <span class="punct">(</span><span class="constant">RUBY_PLATFORM</span> <span class="punct">=~</span> <span class="punct">/</span><span class="regex">dos|win32|cygwin</span><span class="punct">/</span><span class="ident">i</span><span class="punct">)</span> <span class="punct">||</span> <span class="punct">(</span><span class="constant">RUBY_PLATFORM</span> <span class="punct">=~</span> <span class="punct">/</span><span class="regex">(:?mswin|mingw)</span><span class="punct">/)</span>
-
- <span class="ident">record</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">m</span><span class="punct">|</span>
- <span class="comment"># Root directory and all subdirectories.</span>
- <span class="ident">m</span><span class="punct">.</span><span class="ident">directory</span> <span class="punct">'</span><span class="string"></span><span class="punct">'</span>
- <span class="constant">BASEDIRS</span><span class="punct">.</span><span class="ident">each</span> <span class="punct">{</span> <span class="punct">|</span><span class="ident">path</span><span class="punct">|</span> <span class="ident">m</span><span class="punct">.</span><span class="ident">directory</span> <span class="ident">path</span> <span class="punct">}</span>
-
- <span class="comment"># Root</span>
- <span class="ident">m</span><span class="punct">.</span><span class="ident">template_copy_each</span> <span class="punct">%w(</span><span class="string"> Rakefile </span><span class="punct">)</span>
- <span class="ident">m</span><span class="punct">.</span><span class="ident">file_copy_each</span> <span class="punct">%w(</span><span class="string"> README.txt </span><span class="punct">)</span>
-
- <span class="comment"># Test helper</span>
- <span class="ident">m</span><span class="punct">.</span><span class="ident">template</span> <span class="punct">&quot;</span><span class="string">test_helper.rb</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">test/test_helper.rb</span><span class="punct">&quot;</span>
-
- <span class="comment"># Scripts</span>
- <span class="punct">%w(</span><span class="string"> generate </span><span class="punct">).</span><span class="ident">each</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">file</span><span class="punct">|</span>
- <span class="ident">m</span><span class="punct">.</span><span class="ident">template</span> <span class="punct">&quot;</span><span class="string">script/<span class="expr">#{file}</span></span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">script/<span class="expr">#{file}</span></span><span class="punct">&quot;,</span> <span class="ident">script_options</span>
- <span class="ident">m</span><span class="punct">.</span><span class="ident">template</span> <span class="punct">&quot;</span><span class="string">script/win_script.cmd</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">script/<span class="expr">#{file}</span>.cmd</span><span class="punct">&quot;,</span>
- <span class="symbol">:assigns</span> <span class="punct">=&gt;</span> <span class="punct">{</span> <span class="symbol">:filename</span> <span class="punct">=&gt;</span> <span class="ident">file</span> <span class="punct">}</span> <span class="keyword">if</span> <span class="ident">windows</span>
- <span class="keyword">end</span>
-
- <span class="keyword">end</span>
- <span class="keyword">end</span>
-
- <span class="ident">protected</span>
- <span class="keyword">def </span><span class="method">banner</span>
- <span class="punct">&lt;&lt;-</span><span class="constant">EOS</span><span class="string">
-Create a stub for <span class="expr">#{File.basename $0}</span> to get started.
-
-Usage: <span class="expr">#{File.basename $0}</span> /path/to/your/app [options]&quot;
-</span><span class="constant">EOS</span>
- <span class="keyword">end</span>
-
- <span class="keyword">def </span><span class="method">add_options!</span><span class="punct">(</span><span class="ident">opts</span><span class="punct">)</span>
- <span class="ident">opts</span><span class="punct">.</span><span class="ident">separator</span> <span class="punct">'</span><span class="string"></span><span class="punct">'</span>
- <span class="ident">opts</span><span class="punct">.</span><span class="ident">separator</span> <span class="punct">&quot;</span><span class="string"><span class="expr">#{File.basename $0}</span> options:</span><span class="punct">&quot;</span>
- <span class="ident">opts</span><span class="punct">.</span><span class="ident">on</span><span class="punct">(&quot;</span><span class="string">-v</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">--version</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">Show the <span class="expr">#{File.basename($0)}</span> version number and quit.</span><span class="punct">&quot;)</span>
- <span class="keyword">end</span>
-
- <span class="comment"># Installation skeleton. Intermediate directories are automatically</span>
- <span class="comment"># created so don't sweat their absence here.</span>
- <span class="constant">BASEDIRS</span> <span class="punct">=</span> <span class="punct">%w(</span><span class="string">
- doc
- lib
- log
- script
- test
- tmp
- </span><span class="punct">)</span>
-<span class="keyword">end</span>
-</pre></p>
-<p>Easy peasy.</p>
-<h2>Creating a Component Generator for your Framework</h2>
-<p>You can include Component Generators in RubyGems, and they will be automatially picked up<br />
-by your framework&#8217;s <code>script/generate</code> script.</p>
-<h3>Easy way</h3>
-<p>Use <a href="http://newgem.rubyforge.org/">newgem</a>, (v0.13.0+), and run:</p>
-<pre>
-script/generate component_generator
-</pre>
-<p>and follow the instructions.</p>
-<h2>Live at RubyConf 2007</h2>
-<p>RubiGen had the 9am, Sunday timeslot at RubyConf 2007 and was <a href="http://rubyconf2007.confreaks.com/d3t1p1_rubigen.html">recorded for your viewing pleasure</a>.</p>
-<h2>Forum</h2>
-<p><a href="http://groups.google.com/group/rubigen">http://groups.google.com/group/rubigen</a></p>
-<h2>How to submit patches</h2>
-<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
-<p>The source for this project is available via git. You can <a href="http://github.com/drnic/rubigen/tree/master">browse and/or fork the source</a>, or to clone the project locally:<br />
- <br />
-<pre>git clone git://github.com/drnic/rubigen.git</pre></p>
-<p>The original Subversion repository is <code>svn://rubyforge.org/var/svn/rubigen/trunk</code> for anonymous access.</p>
-<h2>Thanks go to&#8230;</h2>
-<p><a href="http://bitsweat.net/">Jeremy Kemper</a> (bitsweat) who wrote the original <a href="http://dev.rubyonrails.org">Rails Generator</a>.</p>
-<h2>License</h2>
-<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
-<h2>Contact</h2>
-<p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a> via the <a href="http://groups.google.com/group/rubigen">forum</a></p>
- <p class="coda">
- <a href="drnicwilliams@gmail.com">Dr Nic Williams</a>, 27th December 2008<br>
- Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
- </p>
-</div>
-<!-- insert site tracking codes here, like Google Urchin -->
-</body>
-</html>
View
258 website/index.txt
@@ -1,258 +0,0 @@
-h1. rubigen
-
-h1. Ruby Generator Framework
-
-h2. What
-
-A framework to allow Ruby applications to generate file/folder stubs (like the <code>rails</code> command does for Ruby on Rails, and the 'script/generate' command within a Rails application during development).
-
-The RubyConf 2007 presentation is now "online":http://rubyconf2007.confreaks.com/d3t1p1_rubigen.html together with the theme from the A-Team.
-
-h2. Background
-
-RubiGen is originally extracted from Ruby on Rails (specifically the rails_generator from its railties gem).
-
-The rails_generator was hardcoded with Rails-specific dependencies (<code>RAILS_ROOT</code>), Rails generators ('app' = Rails application; 'model' = Rails model+tests+migration), and generally assumed it was the only generator framework within the Ruby world (it was). So, any RubyGem whose name ended with '_generator' was assumed to be a generator for a Rails application.
-
-But if you are developing an Adhearsion application, then you may want a different set of generators.
-If you are developing a RubyGem, then you will want a different set of generators.
-
-RubiGen exists to give different development environments their own generator framework.
-
-h2. Installing
-
-RubiGen is only required at development time, and normally isn't required at deployment time (unless your application uses it to generate files etc for its users).
-
-On your development machine:
-
-<pre syntax="ruby">sudo gem install rubigen</pre>
-
-h2. Usage
-
-RubiGen will be normally integrated into another RubyGem, such as <code>newgem</code> or <code>rails</code> or <code>camping</code>, rather than be used on its own.
-
-These frameworks might use RubiGen for two reasons:
-
-# To generate an initial stub for developers, e.g. <code>rails</code> generated a stub to write a Rails application. <code>newgem</code> generates a stub to write a RubyGem. <br/>
- BTW - RubiGen has a builtin application <code>ruby_app</code> which generates a bare-bones Ruby application stub (lib, test, and script folders, plus a Rakefile, and a script/generate script)
-# To generate components within their development areas, e.g. Rails had its <code>script/generate</code> script within each Rails application, which hooked back into the rails_generator to lookup and execute generators.
-
-So, there are two steps to integrating RubiGen into your framework:
-
-# Use it to generate an initial stub for the developers of your framework. This would create the folders
- (<code>lib/app</code>, <code>test</code>, <code>script</code>, <code>doc</code>, <code>log</code>, etc) and starting files (<code>Rakefile</code>,
- <code>README.txt</code>, <code>test/test_helper.rb</code> etc). Importantly, it would generate a <code>script/generate</code> file.
- The <code>script/generate</code> file (example below) will allow developers of your framework to
- generate components/extensions within the framework. <br />
- RubiGen allows you to restrict which generators are available. For example, within
- RubyGem development environment (as generated by <code>newgem</code>), the <code>script/generator</code>
- only shows <code>rubygem</code>-related generators. Rails could restrict <code>script/generator</code>
- to only show Rails related generators
-# Your framework RubyGem (e.g. <code>newgem</code> or <code>rails</code> RubyGems) needs to add <code>rubigen</code> as a
- dependency, so that users of your RubyGem can access the generator framework.
-
-h1. Creating generators
-
-There are two types of generators:
-
-# Application Generators - used by developers of your framework to get started.
- Generally, you will create one Application Generator for your framework.
- It generates a base stub (such as the <code>rails</code> stub for new Rails applications)
- for your framework users.
-# Component Generators - used by developers to extend their application.
- You may include 1+ built-in generators with your framework.
- Developers can also write generators for your framework, and like Rails' generator
- install them in various places and have access to their via RubiGen.
-
-h2. Creating an Application Generator for your Framework
-
-h3. Easy way
-
-"newgem":http://newgem.rubyforge.org/ (v0.13.0+) can generate an Application Generator
-for a RubyGem.
-
-# Create new RubyGem: <code>newgem foobar</code>
-# Create generator: <code>script/generator application_generator foobar</code>
-# Update tests + generator
-# Install
-# Run with: foobar
-
-For more documentation, run <code>script/generator application_generator</code>
-
-h3. DIY
-
-Without RubiGen, to give your users a head start and create a stub for them, you will
-copiously use <code>mkdir_p</code> and <code>File.open</code>. Your script will either be primitive (only
-create the bare folders and very few files) or it will be very long and unreadable
-(ok, perhaps I'm just talking about the <code>newgem</code> script, which I am dubiously responsible
-for... :P).
-
-With RubiGen, you can create stubs using powerful, yet simple, syntax. Templates are
-extracted into a <code>templates</code> folder, and activating the generator from a script requires
-only a few lines of code.
-
-These are the <code>newgem</code> files related to its Application Generator.
-
- bin/
- bin/newgem # Appliction Generator script; Usage: newgem gemname [options]
- app_generators/
- app_generators/newgem/
- app_generators/newgem/newgem_generator.rb
- app_generators/newgem/USAGE
- app_generators/newgem/templates/
- app_generators/newgem/templates/app.rb
- app_generators/newgem/templates/History.txt
- app_generators/newgem/templates/... lots and lots of templates
-
-The <code>bin/newgem</code> script is very simple, and looks like:
-
-<pre syntax="ruby">
-require 'rubygems'
-require 'rubigen'
-
-if %w(-v --version).include? ARGV.first
- require 'newgem/version'
- puts "#{File.basename($0)} #{Newgem::VERSION}"
- exit(0)
-end
-
-require 'rubigen/scripts/generate'
-RubiGen::Base.use_application_sources!
-RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'newgem')
-</pre>
-
-You can copy and paste this for your own generator script, and place it in your RubyGem's <code>bin</code> folder.
-Change <code>newgem</code> to your RubyGem's name in the script above (and in all the folders listed above too)
-
-NOTE: If you leave <code>newgem</code> there, then it will execute the <code>newgem_generator.rb</code> generator;
-as the generators are loaded from all RubyGem's having <code>/app_generators</code> folders.
-
-So, for your RubyGem, you need to keep the <code>/app_generators</code> folder (as you are creating an
-Application Generator, not a Component Generator), but change <code>newgem</code> to <code>your gem name</code> in
-all the subfolders and files. ESPECIALLY <code>newgem_generator.rb</code> -> <code>yourgem_generator.rb</code>,
-as this is how the generator is discovered (via <code>RubiGen::Base.use_application_sources!</code>).
-
-All the generator work is performed within <code>yourgem_generator.rb</code>. A stub for it will be:
-
-<pre syntax="ruby">
-require 'rbconfig'
-
-class YourgemGenerator < RubiGen::Base
- DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
- Config::CONFIG['ruby_install_name'])
-
- default_options :shebang => DEFAULT_SHEBANG,
- :an_option => 'some_default'
-
- attr_reader :app_name, :module_name
-
- def initialize(runtime_args, runtime_options = {})
- super
- usage if args.empty?
- @destination_root = args.shift
- @app_name = File.basename(File.expand_path(@destination_root))
- @module_name = app_name.camelize
- extract_options
- end
-
- def manifest
- # Use /usr/bin/env if no special shebang was specified
- script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
- windows = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
-
- record do |m|
- # Root directory and all subdirectories.
- m.directory ''
- BASEDIRS.each { |path| m.directory path }
-
- # Root
- m.template_copy_each %w( Rakefile )
- m.file_copy_each %w( README.txt )
-
- # Test helper
- m.template "test_helper.rb", "test/test_helper.rb"
-
- # Scripts
- %w( generate ).each do |file|
- m.template "script/#{file}", "script/#{file}", script_options
- m.template "script/win_script.cmd", "script/#{file}.cmd",
- :assigns => { :filename => file } if windows
- end
-
- end
- end
-
- protected
- def banner
- <<-EOS
-Create a stub for #{File.basename $0} to get started.
-
-Usage: #{File.basename $0} /path/to/your/app [options]"
-EOS
- end
-
- def add_options!(opts)
- opts.separator ''
- opts.separator "#{File.basename $0} options:"
- opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
- end
-
- # Installation skeleton. Intermediate directories are automatically
- # created so don't sweat their absence here.
- BASEDIRS = %w(
- doc
- lib
- log
- script
- test
- tmp
- )
-end
-</pre>
-
-Easy peasy.
-
-h2. Creating a Component Generator for your Framework
-
-You can include Component Generators in RubyGems, and they will be automatially picked up
-by your framework's <code>script/generate</code> script.
-
-h3. Easy way
-
-Use "newgem":http://newgem.rubyforge.org/, (v0.13.0+), and run:
-
-<pre>
-script/generate component_generator
-</pre>
-
-and follow the instructions.
-
-h2. Live at RubyConf 2007
-
-RubiGen had the 9am, Sunday timeslot at RubyConf 2007 and was "recorded for your viewing pleasure":http://rubyconf2007.confreaks.com/d3t1p1_rubigen.html.
-
-h2. Forum
-
-"http://groups.google.com/group/rubigen":http://groups.google.com/group/rubigen
-
-h2. How to submit patches
-
-Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
-
-The source for this project is available via git. You can "browse and/or fork the source":http://github.com/drnic/rubigen/tree/master, or to clone the project locally:
-
-<pre>git clone git://github.com/drnic/rubigen.git</pre>
-
-The original Subversion repository is <code>svn://rubyforge.org/var/svn/rubigen/trunk</code> for anonymous access.
-
-h2. Thanks go to...
-
-"Jeremy Kemper":http://bitsweat.net/ (bitsweat) who wrote the original "Rails Generator":http://dev.rubyonrails.org.
-
-h2. License
-
-This code is free to use under the terms of the MIT license.
-
-h2. Contact
-
-Comments are welcome. Send an email to "Dr Nic Williams":mailto:drnicwilliams@gmail.com via the "forum":http://groups.google.com/group/rubigen
View
285 website/javascripts/rounded_corners_lite.inc.js
@@ -1,285 +0,0 @@
-
- /****************************************************************
- * *
- * curvyCorners *
- * ------------ *
- * *
- * This script generates rounded corners for your divs. *
- * *
- * Version 1.2.9 *
- * Copyright (c) 2006 Cameron Cooke *
- * By: Cameron Cooke and Tim Hutchison. *
- * *
- * *
- * Website: http://www.curvycorners.net *
- * Email: info@totalinfinity.com *
- * Forum: http://www.curvycorners.net/forum/ *
- * *
- * *
- * This library is free software; you can redistribute *
- * it and/or modify it under the terms of the GNU *
- * Lesser General Public License as published by the *
- * Free Software Foundation; either version 2.1 of the *
- * License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will *
- * be useful, but WITHOUT ANY WARRANTY; without even the *
- * implied warranty of MERCHANTABILITY or FITNESS FOR A *
- * PARTICULAR PURPOSE. See the GNU Lesser General Public *
- * License for more details. *
- * *
- * You should have received a copy of the GNU Lesser *
- * General Public License along with this library; *
- * Inc., 59 Temple Place, Suite 330, Boston, *
- * MA 02111-1307 USA *
- * *
- ****************************************************************/
-
-var isIE = navigator.userAgent.toLowerCase().indexOf("msie") > -1; var isMoz = document.implementation && document.implementation.createDocument; var isSafari = ((navigator.userAgent.toLowerCase().indexOf('safari')!=-1)&&(navigator.userAgent.toLowerCase().indexOf('mac')!=-1))?true:false; function curvyCorners()
-{ if(typeof(arguments[0]) != "object") throw newCurvyError("First parameter of curvyCorners() must be an object."); if(typeof(arguments[1]) != "object" && typeof(arguments[1]) != "string") throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name."); if(typeof(arguments[1]) == "string")
-{ var startIndex = 0; var boxCol = getElementsByClass(arguments[1]);}
-else
-{ var startIndex = 1; var boxCol = arguments;}
-var curvyCornersCol = new Array(); if(arguments[0].validTags)
-var validElements = arguments[0].validTags; else
-var validElements = ["div"]; for(var i = startIndex, j = boxCol.length; i < j; i++)
-{ var currentTag = boxCol[i].tagName.toLowerCase(); if(inArray(validElements, currentTag) !== false)
-{ curvyCornersCol[curvyCornersCol.length] = new curvyObject(arguments[0], boxCol[i]);}
-}
-this.objects = curvyCornersCol; this.applyCornersToAll = function()
-{ for(var x = 0, k = this.objects.length; x < k; x++)
-{ this.objects[x].applyCorners();}
-}
-}
-function curvyObject()
-{ this.box = arguments[1]; this.settings = arguments[0]; this.topContainer = null; this.bottomContainer = null; this.masterCorners = new Array(); this.contentDIV = null; var boxHeight = get_style(this.box, "height", "height"); var boxWidth = get_style(this.box, "width", "width"); var borderWidth = get_style(this.box, "borderTopWidth", "border-top-width"); var borderColour = get_style(this.box, "borderTopColor", "border-top-color"); var boxColour = get_style(this.box, "backgroundColor", "background-color"); var backgroundImage = get_style(this.box, "backgroundImage", "background-image"); var boxPosition = get_style(this.box, "position", "position"); var boxPadding = get_style(this.box, "paddingTop", "padding-top"); this.boxHeight = parseInt(((boxHeight != "" && boxHeight != "auto" && boxHeight.indexOf("%") == -1)? boxHeight.substring(0, boxHeight.indexOf("px")) : this.box.scrollHeight)); this.boxWidth = parseInt(((boxWidth != "" && boxWidth != "auto" && boxWidth.indexOf("%") == -1)? boxWidth.substring(0, boxWidth.indexOf("px")) : this.box.scrollWidth)); this.borderWidth = parseInt(((borderWidth != "" && borderWidth.indexOf("px") !== -1)? borderWidth.slice(0, borderWidth.indexOf("px")) : 0)); this.boxColour = format_colour(boxColour); this.boxPadding = parseInt(((boxPadding != "" && boxPadding.indexOf("px") !== -1)? boxPadding.slice(0, boxPadding.indexOf("px")) : 0)); this.borderColour = format_colour(borderColour); this.borderString = this.borderWidth + "px" + " solid " + this.borderColour; this.backgroundImage = ((backgroundImage != "none")? backgroundImage : ""); this.boxContent = this.box.innerHTML; if(boxPosition != "absolute") this.box.style.position = "relative"; this.box.style.padding = "0px"; if(isIE && boxWidth == "auto" && boxHeight == "auto") this.box.style.width = "100%"; if(this.settings.autoPad == true && this.boxPadding > 0)
-this.box.innerHTML = ""; this.applyCorners = function()
-{ for(var t = 0; t < 2; t++)
-{ switch(t)
-{ case 0:
-if(this.settings.tl || this.settings.tr)
-{ var newMainContainer = document.createElement("DIV"); newMainContainer.style.width = "100%"; newMainContainer.style.fontSize = "1px"; newMainContainer.style.overflow = "hidden"; newMainContainer.style.position = "absolute"; newMainContainer.style.paddingLeft = this.borderWidth + "px"; newMainContainer.style.paddingRight = this.borderWidth + "px"; var topMaxRadius = Math.max(this.settings.tl ? this.settings.tl.radius : 0, this.settings.tr ? this.settings.tr.radius : 0); newMainContainer.style.height = topMaxRadius + "px"; newMainContainer.style.top = 0 - topMaxRadius + "px"; newMainContainer.style.left = 0 - this.borderWidth + "px"; this.topContainer = this.box.appendChild(newMainContainer);}
-break; case 1:
-if(this.settings.bl || this.settings.br)
-{ var newMainContainer = document.createElement("DIV"); newMainContainer.style.width = "100%"; newMainContainer.style.fontSize = "1px"; newMainContainer.style.overflow = "hidden"; newMainContainer.style.position = "absolute"; newMainContainer.style.paddingLeft = this.borderWidth + "px"; newMainContainer.style.paddingRight = this.borderWidth + "px"; var botMaxRadius = Math.max(this.settings.bl ? this.settings.bl.radius : 0, this.settings.br ? this.settings.br.radius : 0); newMainContainer.style.height = botMaxRadius + "px"; newMainContainer.style.bottom = 0 - botMaxRadius + "px"; newMainContainer.style.left = 0 - this.borderWidth + "px"; this.bottomContainer = this.box.appendChild(newMainContainer);}
-break;}
-}
-if(this.topContainer) this.box.style.borderTopWidth = "0px"; if(this.bottomContainer) this.box.style.borderBottomWidth = "0px"; var corners = ["tr", "tl", "br", "bl"]; for(var i in corners)
-{ if(i > -1 < 4)
-{ var cc = corners[i]; if(!this.settings[cc])
-{ if(((cc == "tr" || cc == "tl") && this.topContainer != null) || ((cc == "br" || cc == "bl") && this.bottomContainer != null))
-{ var newCorner = document.createElement("DIV"); newCorner.style.position = "relative"; newCorner.style.fontSize = "1px"; newCorner.style.overflow = "hidden"; if(this.backgroundImage == "")
-newCorner.style.backgroundColor = this.boxColour; else
-newCorner.style.backgroundImage = this.backgroundImage; switch(cc)
-{ case "tl":
-newCorner.style.height = topMaxRadius - this.borderWidth + "px"; newCorner.style.marginRight = this.settings.tr.radius - (this.borderWidth*2) + "px"; newCorner.style.borderLeft = this.borderString; newCorner.style.borderTop = this.borderString; newCorner.style.left = -this.borderWidth + "px"; break; case "tr":
-newCorner.style.height = topMaxRadius - this.borderWidth + "px"; newCorner.style.marginLeft = this.settings.tl.radius - (this.borderWidth*2) + "px"; newCorner.style.borderRight = this.borderString; newCorner.style.borderTop = this.borderString; newCorner.style.backgroundPosition = "-" + (topMaxRadius + this.borderWidth) + "px 0px"; newCorner.style.left = this.borderWidth + "px"; break; case "bl":
-newCorner.style.height = botMaxRadius - this.borderWidth + "px"; newCorner.style.marginRight = this.settings.br.radius - (this.borderWidth*2) + "px"; newCorner.style.borderLeft = this.borderString; newCorner.style.borderBottom = this.borderString; newCorner.style.left = -this.borderWidth + "px"; newCorner.style.backgroundPosition = "-" + (this.borderWidth) + "px -" + (this.boxHeight + (botMaxRadius + this.borderWidth)) + "px"; break; case "br":
-newCorner.style.height = botMaxRadius - this.borderWidth + "px"; newCorner.style.marginLeft = this.settings.bl.radius - (this.borderWidth*2) + "px"; newCorner.style.borderRight = this.borderString; newCorner.style.borderBottom = this.borderString; newCorner.style.left = this.borderWidth + "px"
-newCorner.style.backgroundPosition = "-" + (botMaxRadius + this.borderWidth) + "px -" + (this.boxHeight + (botMaxRadius + this.borderWidth)) + "px"; break;}
-}
-}
-else
-{ if(this.masterCorners[this.settings[cc].radius])
-{ var newCorner = this.masterCorners[this.settings[cc].radius].cloneNode(true);}
-else
-{ var newCorner = document.createElement("DIV"); newCorner.style.height = this.settings[cc].radius + "px"; newCorner.style.width = this.settings[cc].radius + "px"; newCorner.style.position = "absolute"; newCorner.style.fontSize = "1px"; newCorner.style.overflow = "hidden"; var borderRadius = parseInt(this.settings[cc].radius - this.borderWidth); for(var intx = 0, j = this.settings[cc].radius; intx < j; intx++)
-{ if((intx +1) >= borderRadius)
-var y1 = -1; else
-var y1 = (Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow((intx+1), 2))) - 1); if(borderRadius != j)
-{ if((intx) >= borderRadius)
-var y2 = -1; else
-var y2 = Math.ceil(Math.sqrt(Math.pow(borderRadius,2) - Math.pow(intx, 2))); if((intx+1) >= j)
-var y3 = -1; else
-var y3 = (Math.floor(Math.sqrt(Math.pow(j ,2) - Math.pow((intx+1), 2))) - 1);}
-if((intx) >= j)
-var y4 = -1; else
-var y4 = Math.ceil(Math.sqrt(Math.pow(j ,2) - Math.pow(intx, 2))); if(y1 > -1) this.drawPixel(intx, 0, this.boxColour, 100, (y1+1), newCorner, -1, this.settings[cc].radius); if(borderRadius != j)
-{ for(var inty = (y1 + 1); inty < y2; inty++)
-{ if(this.settings.antiAlias)
-{ if(this.backgroundImage != "")
-{ var borderFract = (pixelFraction(intx, inty, borderRadius) * 100); if(borderFract < 30)
-{ this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, 0, this.settings[cc].radius);}
-else
-{ this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, -1, this.settings[cc].radius);}
-}
-else
-{ var pixelcolour = BlendColour(this.boxColour, this.borderColour, pixelFraction(intx, inty, borderRadius)); this.drawPixel(intx, inty, pixelcolour, 100, 1, newCorner, 0, this.settings[cc].radius, cc);}
-}
-}
-if(this.settings.antiAlias)
-{ if(y3 >= y2)
-{ if (y2 == -1) y2 = 0; this.drawPixel(intx, y2, this.borderColour, 100, (y3 - y2 + 1), newCorner, 0, 0);}
-}
-else
-{ if(y3 >= y1)
-{ this.drawPixel(intx, (y1 + 1), this.borderColour, 100, (y3 - y1), newCorner, 0, 0);}
-}
-var outsideColour = this.borderColour;}
-else
-{ var outsideColour = this.boxColour; var y3 = y1;}
-if(this.settings.antiAlias)
-{ for(var inty = (y3 + 1); inty < y4; inty++)
-{ this.drawPixel(intx, inty, outsideColour, (pixelFraction(intx, inty , j) * 100), 1, newCorner, ((this.borderWidth > 0)? 0 : -1), this.settings[cc].radius);}
-}
-}
-this.masterCorners[this.settings[cc].radius] = newCorner.cloneNode(true);}
-if(cc != "br")
-{ for(var t = 0, k = newCorner.childNodes.length; t < k; t++)
-{ var pixelBar = newCorner.childNodes[t]; var pixelBarTop = parseInt(pixelBar.style.top.substring(0, pixelBar.style.top.indexOf("px"))); var pixelBarLeft = parseInt(pixelBar.style.left.substring(0, pixelBar.style.left.indexOf("px"))); var pixelBarHeight = parseInt(pixelBar.style.height.substring(0, pixelBar.style.height.indexOf("px"))); if(cc == "tl" || cc == "bl"){ pixelBar.style.left = this.settings[cc].radius -pixelBarLeft -1 + "px";}
-if(cc == "tr" || cc == "tl"){ pixelBar.style.top = this.settings[cc].radius -pixelBarHeight -pixelBarTop + "px";}
-switch(cc)
-{ case "tr":
-pixelBar.style.backgroundPosition = "-" + Math.abs((this.boxWidth - this.settings[cc].radius + this.borderWidth) + pixelBarLeft) + "px -" + Math.abs(this.settings[cc].radius -pixelBarHeight -pixelBarTop - this.borderWidth) + "px"; break; case "tl":
-pixelBar.style.backgroundPosition = "-" + Math.abs((this.settings[cc].radius -pixelBarLeft -1) - this.borderWidth) + "px -" + Math.abs(this.settings[cc].radius -pixelBarHeight -pixelBarTop - this.borderWidth) + "px"; break; case "bl":
-pixelBar.style.backgroundPosition = "-" + Math.abs((this.settings[cc].radius -pixelBarLeft -1) - this.borderWidth) + "px -" + Math.abs((this.boxHeight + this.settings[cc].radius + pixelBarTop) -this.borderWidth) + "px"; break;}
-}
-}
-}
-if(newCorner)
-{ switch(cc)
-{ case "tl":
-if(newCorner.style.position == "absolute") newCorner.style.top = "0px"; if(newCorner.style.position == "absolute") newCorner.style.left = "0px"; if(this.topContainer) this.topContainer.appendChild(newCorner); break; case "tr":
-if(newCorner.style.position == "absolute") newCorner.style.top = "0px"; if(newCorner.style.position == "absolute") newCorner.style.right = "0px"; if(this.topContainer) this.topContainer.appendChild(newCorner); break; case "bl":
-if(newCorner.style.position == "absolute") newCorner.style.bottom = "0px"; if(newCorner.style.position == "absolute") newCorner.style.left = "0px"; if(this.bottomContainer) this.bottomContainer.appendChild(newCorner); break; case "br":
-if(newCorner.style.position == "absolute") newCorner.style.bottom = "0px"; if(newCorner.style.position == "absolute") newCorner.style.right = "0px"; if(this.bottomContainer) this.bottomContainer.appendChild(newCorner); break;}
-}
-}
-}
-var radiusDiff = new Array(); radiusDiff["t"] = Math.abs(this.settings.tl.radius - this.settings.tr.radius)
-radiusDiff["b"] = Math.abs(this.settings.bl.radius - this.settings.br.radius); for(z in radiusDiff)
-{ if(z == "t" || z == "b")
-{ if(radiusDiff[z])
-{ var smallerCornerType = ((this.settings[z + "l"].radius < this.settings[z + "r"].radius)? z +"l" : z +"r"); var newFiller = document.createElement("DIV"); newFiller.style.height = radiusDiff[z] + "px"; newFiller.style.width = this.settings[smallerCornerType].radius+ "px"
-newFiller.style.position = "absolute"; newFiller.style.fontSize = "1px"; newFiller.style.overflow = "hidden"; newFiller.style.backgroundColor = this.boxColour; switch(smallerCornerType)
-{ case "tl":
-newFiller.style.bottom = "0px"; newFiller.style.left = "0px"; newFiller.style.borderLeft = this.borderString; this.topContainer.appendChild(newFiller); break; case "tr":
-newFiller.style.bottom = "0px"; newFiller.style.right = "0px"; newFiller.style.borderRight = this.borderString; this.topContainer.appendChild(newFiller); break; case "bl":
-newFiller.style.top = "0px"; newFiller.style.left = "0px"; newFiller.style.borderLeft = this.borderString; this.bottomContainer.appendChild(newFiller); break; case "br":
-newFiller.style.top = "0px"; newFiller.style.right = "0px"; newFiller.style.borderRight = this.borderString; this.bottomContainer.appendChild(newFiller); break;}
-}
-var newFillerBar = document.createElement("DIV"); newFillerBar.style.position = "relative"; newFillerBar.style.fontSize = "1px"; newFillerBar.style.overflow = "hidden"; newFillerBar.style.backgroundColor = this.boxColour; newFillerBar.style.backgroundImage = this.backgroundImage; switch(z)
-{ case "t":
-if(this.topContainer)
-{ if(this.settings.tl.radius && this.settings.tr.radius)
-{ newFillerBar.style.height = topMaxRadius - this.borderWidth + "px"; newFillerBar.style.marginLeft = this.settings.tl.radius - this.borderWidth + "px"; newFillerBar.style.marginRight = this.settings.tr.radius - this.borderWidth + "px"; newFillerBar.style.borderTop = this.borderString; if(this.backgroundImage != "")
-newFillerBar.style.backgroundPosition = "-" + (topMaxRadius + this.borderWidth) + "px 0px"; this.topContainer.appendChild(newFillerBar);}
-this.box.style.backgroundPosition = "0px -" + (topMaxRadius - this.borderWidth) + "px";}
-break; case "b":
-if(this.bottomContainer)
-{ if(this.settings.bl.radius && this.settings.br.radius)
-{ newFillerBar.style.height = botMaxRadius - this.borderWidth + "px"; newFillerBar.style.marginLeft = this.settings.bl.radius - this.borderWidth + "px"; newFillerBar.style.marginRight = this.settings.br.radius - this.borderWidth + "px"; newFillerBar.style.borderBottom = this.borderString; if(this.backgroundImage != "")
-newFillerBar.style.backgroundPosition = "-" + (botMaxRadius + this.borderWidth) + "px -" + (this.boxHeight + (topMaxRadius + this.borderWidth)) + "px"; this.bottomContainer.appendChild(newFillerBar);}
-}
-break;}
-}
-}
-if(this.settings.autoPad == true && this.boxPadding > 0)
-{ var contentContainer = document.createElement("DIV"); contentContainer.style.position = "relative"; contentContainer.innerHTML = this.boxContent; contentContainer.className = "autoPadDiv"; var topPadding = Math.abs(topMaxRadius - this.boxPadding); var botPadding = Math.abs(botMaxRadius - this.boxPadding); if(topMaxRadius < this.boxPadding)
-contentContainer.style.paddingTop = topPadding + "px"; if(botMaxRadius < this.boxPadding)
-contentContainer.style.paddingBottom = botMaxRadius + "px"; contentContainer.style.paddingLeft = this.boxPadding + "px"; contentContainer.style.paddingRight = this.boxPadding + "px"; this.contentDIV = this.box.appendChild(contentContainer);}
-}
-this.drawPixel = function(intx, inty, colour, transAmount, height, newCorner, image, cornerRadius)
-{ var pixel = document.createElement("DIV"); pixel.style.height = height + "px"; pixel.style.width = "1px"; pixel.style.position = "absolute"; pixel.style.fontSize = "1px"; pixel.style.overflow = "hidden"; var topMaxRadius = Math.max(this.settings["tr"].radius, this.settings["tl"].radius); if(image == -1 && this.backgroundImage != "")
-{ pixel.style.backgroundImage = this.backgroundImage; pixel.style.backgroundPosition = "-" + (this.boxWidth - (cornerRadius - intx) + this.borderWidth) + "px -" + ((this.boxHeight + topMaxRadius + inty) -this.borderWidth) + "px";}
-else
-{ pixel.style.backgroundColor = colour;}
-if (transAmount != 100)
-setOpacity(pixel, transAmount); pixel.style.top = inty + "px"; pixel.style.left = intx + "px"; newCorner.appendChild(pixel);}
-}
-function insertAfter(parent, node, referenceNode)
-{ parent.insertBefore(node, referenceNode.nextSibling);}
-function BlendColour(Col1, Col2, Col1Fraction)
-{ var red1 = parseInt(Col1.substr(1,2),16); var green1 = parseInt(Col1.substr(3,2),16); var blue1 = parseInt(Col1.substr(5,2),16); var red2 = parseInt(Col2.substr(1,2),16); var green2 = parseInt(Col2.substr(3,2),16); var blue2 = parseInt(Col2.substr(5,2),16); if(Col1Fraction > 1 || Col1Fraction < 0) Col1Fraction = 1; var endRed = Math.round((red1 * Col1Fraction) + (red2 * (1 - Col1Fraction))); if(endRed > 255) endRed = 255; if(endRed < 0) endRed = 0; var endGreen = Math.round((green1 * Col1Fraction) + (green2 * (1 - Col1Fraction))); if(endGreen > 255) endGreen = 255; if(endGreen < 0) endGreen = 0; var endBlue = Math.round((blue1 * Col1Fraction) + (blue2 * (1 - Col1Fraction))); if(endBlue > 255) endBlue = 255; if(endBlue < 0) endBlue = 0; return "#" + IntToHex(endRed)+ IntToHex(endGreen)+ IntToHex(endBlue);}
-function IntToHex(strNum)
-{ base = strNum / 16; rem = strNum % 16; base = base - (rem / 16); baseS = MakeHex(base); remS = MakeHex(rem); return baseS + '' + remS;}
-function MakeHex(x)
-{ if((x >= 0) && (x <= 9))
-{ return x;}
-else
-{ switch(x)
-{ case 10: return "A"; case 11: return "B"; case 12: return "C"; case 13: return "D"; case 14: return "E"; case 15: return "F";}
-}
-}
-function pixelFraction(x, y, r)
-{ var pixelfraction = 0; var xvalues = new Array(1); var yvalues = new Array(1); var point = 0; var whatsides = ""; var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(x,2))); if ((intersect >= y) && (intersect < (y+1)))
-{ whatsides = "Left"; xvalues[point] = 0; yvalues[point] = intersect - y; point = point + 1;}
-var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(y+1,2))); if ((intersect >= x) && (intersect < (x+1)))
-{ whatsides = whatsides + "Top"; xvalues[point] = intersect - x; yvalues[point] = 1; point = point + 1;}
-var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(x+1,2))); if ((intersect >= y) && (intersect < (y+1)))
-{ whatsides = whatsides + "Right"; xvalues[point] = 1; yvalues[point] = intersect - y; point = point + 1;}
-var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(y,2))); if ((intersect >= x) && (intersect < (x+1)))
-{ whatsides = whatsides + "Bottom"; xvalues[point] = intersect - x; yvalues[point] = 0;}
-switch (whatsides)
-{ case "LeftRight":
-pixelfraction = Math.min(yvalues[0],yvalues[1]) + ((Math.max(yvalues[0],yvalues[1]) - Math.min(yvalues[0],yvalues[1]))/2); break; case "TopRight":
-pixelfraction = 1-(((1-xvalues[0])*(1-yvalues[1]))/2); break; case "TopBottom":
-pixelfraction = Math.min(xvalues[0],xvalues[1]) + ((Math.max(xvalues[0],xvalues[1]) - Math.min(xvalues[0],xvalues[1]))/2); break; case "LeftBottom":
-pixelfraction = (yvalues[0]*xvalues[1])/2; break; default:
-pixelfraction = 1;}
-return pixelfraction;}
-function rgb2Hex(rgbColour)
-{ try{ var rgbArray = rgb2Array(rgbColour); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); var hexColour = "#" + IntToHex(red) + IntToHex(green) + IntToHex(blue);}
-catch(e){ alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");}
-return hexColour;}
-function rgb2Array(rgbColour)
-{ var rgbValues = rgbColour.substring(4, rgbColour.indexOf(")")); var rgbArray = rgbValues.split(", "); return rgbArray;}
-function setOpacity(obj, opacity)
-{ opacity = (opacity == 100)?99.999:opacity; if(isSafari && obj.tagName != "IFRAME")
-{ var rgbArray = rgb2Array(obj.style.backgroundColor); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); obj.style.backgroundColor = "rgba(" + red + ", " + green + ", " + blue + ", " + opacity/100 + ")";}
-else if(typeof(obj.style.opacity) != "undefined")
-{ obj.style.opacity = opacity/100;}
-else if(typeof(obj.style.MozOpacity) != "undefined")
-{ obj.style.MozOpacity = opacity/100;}
-else if(typeof(obj.style.filter) != "undefined")
-{ obj.style.filter = "alpha(opacity:" + opacity + ")";}
-else if(typeof(obj.style.KHTMLOpacity) != "undefined")
-{ obj.style.KHTMLOpacity = opacity/100;}
-}
-function inArray(array, value)
-{ for(var i = 0; i < array.length; i++){ if (array[i] === value) return i;}
-return false;}
-function inArrayKey(array, value)
-{ for(key in array){ if(key === value) return true;}
-return false;}
-function addEvent(elm, evType, fn, useCapture) { if (elm.addEventListener) { elm.addEventListener(evType, fn, useCapture); return true;}
-else if (elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r;}
-else { elm['on' + evType] = fn;}
-}
-function removeEvent(obj, evType, fn, useCapture){ if (obj.removeEventListener){ obj.removeEventListener(evType, fn, useCapture); return true;} else if (obj.detachEvent){ var r = obj.detachEvent("on"+evType, fn); return r;} else { alert("Handler could not be removed");}
-}
-function format_colour(colour)
-{ var returnColour = "#ffffff"; if(colour != "" && colour != "transparent")
-{ if(colour.substr(0, 3) == "rgb")
-{ returnColour = rgb2Hex(colour);}
-else if(colour.length == 4)
-{ returnColour = "#" + colour.substring(1, 2) + colour.substring(1, 2) + colour.substring(2, 3) + colour.substring(2, 3) + colour.substring(3, 4) + colour.substring(3, 4);}
-else
-{ returnColour = colour;}
-}
-return returnColour;}
-function get_style(obj, property, propertyNS)
-{ try
-{ if(obj.currentStyle)
-{ var returnVal = eval("obj.currentStyle." + property);}
-else
-{ if(isSafari && obj.style.display == "none")
-{ obj.style.display = ""; var wasHidden = true;}
-var returnVal = document.defaultView.getComputedStyle(obj, '').getPropertyValue(propertyNS); if(isSafari && wasHidden)
-{ obj.style.display = "none";}
-}
-}
-catch(e)
-{ }
-return returnVal;}
-function getElementsByClass(searchClass, node, tag)
-{ var classElements = new Array(); if(node == null)
-node = document; if(tag == null)
-tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)"); for (i = 0, j = 0; i < elsLen; i++)
-{ if(pattern.test(els[i].className))
-{ classElements[j] = els[i]; j++;}
-}
-return classElements;}
-function newCurvyError(errorMessage)
-{ return new Error("curvyCorners Error:\n" + errorMessage)
-}
View
155 website/stylesheets/screen.css
@@ -1,155 +0,0 @@
-body {
- background-color: #b33;
- font-family: "Georgia", sans-serif;
- font-size: 16px;
- line-height: 1.6em;
- padding: 1.6em 0 0 0;
- color: #FFF;
-}
-h1, h2, h3, h4, h5, h6 {
- color: #FFF;
-}
-h1 {
- font-family: sans-serif;
- font-weight: normal;
- font-size: 4em;
- line-height: 0.8em;
- letter-spacing: -0.1ex;
- margin: 5px;
-}
-li {
- padding: 0;
- margin: 0;
- list-style-type: square;
-}
-a {
- color: #5E5AFF;
- background-color: #DAC;
- font-weight: normal;
- text-decoration: underline;
-}
-blockquote {
- font-size: 90%;
- font-style: italic;
- border-left: 1px solid #111;
- padding-left: 1em;
-}
-.caps {
- font-size: 80%;
-}
-
-#main {
- width: 45em;
- padding: 0;
- margin: 0 auto;
-}
-.coda {
- text-align: right;
- color: #77f;
- font-size: smaller;
-}
-
-table {
- font-size: 90%;
- line-height: 1.4em;
- color: #ff8;
- background-color: #111;
- padding: 2px 10px 2px 10px;
- border-style: dashed;
-}
-
-th {
- color: #fff;
-}
-
-td {
- padding: 2px 10px 2px 10px;
-}
-
-.success {
- color: #0CC52B;
-}
-
-.failed {
- color: #E90A1B;
-}
-
-.unknown {
- color: #995000;
-}
-pre, code {
- font-family: monospace;
- font-size: 90%;
- line-height: 1.4em;
- color: #ff8;
- background-color: #111;
- padding: 2px 10px 2px 10px;
-}
-.comment { color: #aaa; font-style: italic; }
-.keyword { color: #eff; font-weight: bold; }
-.punct { color: #eee; font-weight: bold; }
-.symbol { color: #0bb; }
-.string { color: #6b4; }
-.ident { color: #ff8; }
-.constant { color: #66f; }
-.regex { color: #ec6; }
-.number { color: #F99; }
-.expr { color: #227; }
-
-.sidebar {
- float: right;
-}
-
-#version {
- width: 170px;
- padding: 15px 20px 10px 20px;
- margin: 0 auto;
- text-align: right;
- font-family: sans-serif;
- font-weight: normal;
- border: 3px solid #DDD;
- background-color: #468EFF;
- color: #EEE;
-}
-
-#version .numbers {
- display: block;
- font-size: 4em;
- line-height: 0.8em;
- letter-spacing: -0.1ex;
- margin-bottom: 15px;
-}
-
-#version p {
- text-decoration: none;
- color: #EEE;
- background-color: #468EFF;
- margin: 0;
- padding: 0;
-}
-
-#version a {
- text-decoration: none;
- color: #EEE;
- background-color: #468EFF;
-}
-
-.clickable {
- cursor: pointer;
- cursor: hand;
-}
-
-#twitter_search {
- margin: 40px 0 10px 15px;
- border: 3px solid #DDD;
- background-color: #468EFF;
-}
-
-#twitter_search h3 {
- margin-bottom: 0px;
-}
-
-#twitter_search center b {
- display: none;
-}
-
View
3  website/template.js
@@ -1,3 +0,0 @@
-// <%= title %>
-var version = <%= version.to_json %>;
-<%= body %>
View
64 website/template.rhtml
@@ -1,64 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>
- <%= title %>
- </title>
- <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
-<style>
-</style>
- <script type="text/javascript">
- window.onload = function() {
- settings = {
- tl: { radius: 10 },
- tr: { radius: 10 },
- bl: { radius: 10 },
- br: { radius: 10 },
- antiAlias: true,
- autoPad: true,
- validTags: ["div"]
- }
- var versionBox = new curvyCorners(settings, document.getElementById("version"));
- versionBox.applyCornersToAll();
-
- var twitterBox = new curvyCorners(settings, document.getElementById("twitter_search"));
- twitterBox.applyCornersToAll();
- }
- </script>
-</head>
-<body>
-<div id="main">
- <h1><%= title %></h1>
- <div class="sidebar">
- <div id="version" class="clickable" onclick='document.location = "<%= download %>"; return false'>
- <p>Get Version</p>
- <a href="<%= download %>" class="numbers"><%= version %></a>
- </div>
-
- <div id="twitter_search">
- <h3>Heard on twitter ('rubigen')...</h3>
- <!-- HELP FILE - http://twitterwidget.jazzychad.com/tw/ -->
- <script language = "javascript">
- var jtw_search = 'rubigen';
- var jtw_widget_background = 'd77';
- var jtw_widget_border = '0';
- var jtw_tweet_textcolor = 'fff';
- var jtw_tweet_background = '000';
- var jtw_tweet_border = '0px';
- </script>
- <script src="http://twitterwidget.jazzychad.com/tw/searchwidget.js" type="text/javascript"></script>
- </div>
-
- </div>
- <%= body %>
- <p class="coda">
- <a href="drnicwilliams@gmail.com">Dr Nic Williams</a>, <%= modified.pretty %><br>
- Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
- </p>
-</div>
-<!-- insert site tracking codes here, like Google Urchin -->
-</body>
-</html>
View
3  website/version-raw.js
@@ -1,3 +0,0 @@
-// Announcement JS file
-var version = "1.3.2";
-MagicAnnouncement.show('compositekeys', version);
View
2  website/version-raw.txt
@@ -1,2 +0,0 @@
-h1. Announcement JS file
-MagicAnnouncement.show('compositekeys', version);
View
4 website/version.js
@@ -1,4 +0,0 @@
-// Version JS file
-var version = "1.3.2";
-
-document.write(" - " + version);
View
3  website/version.txt
@@ -1,3 +0,0 @@
-h1. Version JS file
-
-document.write(" - " + version);
Please sign in to comment.
Something went wrong with that request. Please try again.