<commit_before>h1. Dirt Readme

Dirt is a reporting frontend to Best Practical ["Request Tracker":http://bestpractical.com/rt/]. 
It was written to facilitate my work at ["Directi":http://www.directi.com], who 
kindly let me work on it during regular working hours.

h3. Features

* An arbitrary number of dashboards
* A wiki for documentation
* Tabular reports 
* Prettier than RT (IMO)
* ... more to come (see TODO list below)

h3. Installation

Installation is still pretty clunky:	

* Clone the source
* Install Ruby 1.9.3 if you don't already have it. Using ["rvm":https://rvm.io] 
  for this is highly recommended.
* Run @bundle install@ to fetch dependencies. Using rvm's gemsets feature to 
  isolate these dependencies is a good idea.
* Copy @config/database.yml.sample@ to @config/database.yml@ and edit. Note that
  there are *two* database configurations:
  - @rt@ := Your existing Request Tracker database. With the current featureset 
            this can be read-only access. This will change with later releases.
  - @dirt@ := A new empty database that you have created for dirt.
* Run @rake db:migrate@ to create the dirt schema.
* Run @cd db; ruby create_views.rb < mapping.json > create-views.sql@
* Review @create-views.sql@ -- TL;DR It create a few views so we have a schema 
  that is ORM friendly and to make report queries more intuitive.
* Run @create-views.sql@ against your RT database. Consult your RDBMS documentation
  to find out how to do this. *Note:* @create-views.sql@ uses MySQL's dialect of SQL.
* Run: @RACK_ENV=<env> ruby application.rb@. Ruby rack integration is currently broken.

h4. Really clunky bits

* Add entries into in the projects table in the dirt db. See the default value 
  of @tab_spec@ to configure the tabs of your project.

h3. Using Dirt

* Navigate to http://your.host.name/projects/yourproject/pages
* Use ["textile":http://redcloth.org/textile] syntax to add text content to the page.
* Add a query using the following syntax:

bc..
<~
{
  "type": "table",
  "sql":"SELECT COUNT(id) AS Count, Owner AS Name FROM expanded_tickets WHERE Queue = 'linux-hosting' AND Status IN('new', 'open', 'stalled') GROUP BY Owner",
  "caption": "Ticket Ownership"
}
~><commit_msg>Fix formatting<commit_after>h1. Dirt Readme

Dirt is a reporting frontend to Best Practical ["Request Tracker":http://bestpractical.com/rt/]. It was written to facilitate my work at ["Directi":http://www.directi.com], who kindly let me work on it during regular working hours.

h3. Features

* An arbitrary number of dashboards
* A wiki for documentation
* Tabular reports 
* Prettier than RT (IMO)
* ... more to come (see TODO list below)

h3. Installation

Installation is still pretty clunky:	

* Clone the source
* Install Ruby 1.9.3 if you don't already have it. Using ["rvm":https://rvm.io] for this is highly recommended.
* Run @bundle install@ to fetch dependencies. Using rvm's gemsets feature to isolate these dependencies is a good idea.
* Copy @config/database.yml.sample@ to @config/database.yml@ and edit. Note that there are *two* database configurations:
  - @rt@ := Your existing Request Tracker database. With the current featureset 
            this can be read-only access. This will change with later releases.
  - @dirt@ := A new empty database that you have created for dirt.
* Run @rake db:migrate@ to create the dirt schema.
* Run @cd db; ruby create_views.rb < mapping.json > create-views.sql@
* Review @create-views.sql@ -- TL;DR It create a few views so we have a schema that is ORM friendly and to make report queries more intuitive. 
* Run @create-views.sql@ against your RT database. Consult your RDBMS documentation to find out how to do this. *Note:* @create-views.sql@ uses MySQL's dialect of SQL.
* Run: @RACK_ENV=<env> ruby application.rb@. Ruby rack integration is currently broken.

h4. Really clunky bits

* Add entries into in the projects table in the dirt db. See the default value of @tab_spec@ to configure the tabs of your project.

h3. Using Dirt

* Navigate to http://your.host.name/projects/yourproject/pages
* Use ["textile":http://redcloth.org/textile] syntax to add text content to the page.
* Add a query using the following syntax:

<pre>
<~
{
  "type": "table",
  "sql":"SELECT COUNT(id) AS Count, Owner AS Name FROM expanded_tickets WHERE Queue = 'linux-hosting' AND Status IN('new', 'open', 'stalled') GROUP BY Owner",
  "caption": "Ticket Ownership"
}
~>
</pre>
{'fraction_non_alphanumeric': 0.09788478847884788, 'fraction_numerical': 0.0036003600360036, 'mean_word_length': 3.9334073251942288, 'pattern_counts': {'":': 14, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5124057', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1304, 'n_words': 594}