<commit_before>The official ruby library for interacting with the [RESTful API](http://mite.yo.lk/en/api) of [mite](http://mite.yo.lk/en), a sleek time tracking webapp.

## Install

As a ruby gem from gemcutter:
   
    sudo gem install mite-rb -s http://gemcutter.org

mite-rb requires activeresource and activesupport gems in a current version (2.3.2) to be installed.

## Documentation

You should read the complete mite.api documentation at http://mite.yo.lk/en/api

### Authenticate

The first thing you need to set is the account name.  This is the same as the web address (subdomain) for your account. For example if you use mite from the domain demo.mite.yo.lk:

    Mite.account = 'demo'

Then, you should set the authentication. You can either use your login credentials (email and password) with HTTP Basic Authentication or your mite.api key. In both cases you must enable the mite.api in your user settings.

With basic authentication:

    Mite.authenticate('<EMAIL>', 'spacemonkey')

or, use your api key:

    Mite.key = '<KEY>'

### Validate connection

You can validate the connection/authentication with

    Mite.validate
  
This will return true when the connection is valid and false if not.

Use

    Mite.validate!
  
and mite-rb will raise an exception with further details when the connection is not valid.

### Project

Find all active projects of the current account

    Mite::Project.all
   
Find single project by ID

    Mite::Project.find(1209)
 
Creating a Project

    project = Mite::Project.new(:name => 'Playing with the mite.api')
    project.save

or
 
    project = Mite::Project.create(:name => 'Playing with the mite.api') 
 
Updating a Project

    project = Mite::Project.find(1209)
    project.name = "mite.api"
    project.customer = Mite::Customer.find(384)
    project.save
 
Get the customer of an project

    project = Mite::Project.find(1209)
    project.customer
 
Deleting a project

    project = Mite::Project.find(1209)
    project.destroy

<commit_msg>Fine tuned README<commit_after>## mite-rb

The official ruby library for interacting with the [RESTful API](http://mite.yo.lk/en/api) of [mite](http://mite.yo.lk/en), a sleek time tracking webapp.

## Install

Install the lib as a ruby gem from gemcutter:
   
    sudo gem install mite-rb -s http://gemcutter.org

mite-rb requires activeresource and activesupport in version 2.3.2 or above.

## Documentation

You should read the complete *mite*.api documentation at [http://mite.yo.lk/en/api](http://mite.yo.lk/en/api)

### Authenticate

**IMPORTANT:** To use mite-rb you **must** enable the *mite*.api for your user within the webinterface of *mite*! It is disabled by default.

The first thing you need to set is the account name.  This is the same as the web address (subdomain) for your account. For example if you use *mite* from the domain *demo.mite.yo.lk* set the account to 'demo':

    Mite.account = 'demo'

Then, you should set the authentication. You can either use your mite.api key (recommanded) or your login credentials (email and password).
    
    Mite.key = '<KEY>'
    
or
    
    Mite.authenticate('<EMAIL>', 'spacemonkey')

### Validate connection

You can validate the connection/authentication with

    Mite.validate
  
This will return true when the connection is valid and false if not.

Use

    Mite.validate!
  
and mite-rb will raise an exception with further details when the connection is not valid.

### Project

#### Find all active projects

    Mite::Project.all
   
#### Find single project by ID

    Mite::Project.find(1209)
    
#### Get the customer of a project

    project = Mite::Project.find(1209)
    project.customer
 
#### Creating

    project = Mite::Project.new(:name => 'Playing with the mite.api')
    project.save

or in a single step
 
    project = Mite::Project.create(:name => 'Playing with the mite.api') 
 
#### Updating

    project = Mite::Project.find(1209)
    project.name = "mite.api"
    project.customer = Mite::Customer.find(384)
    project.save
 
#### Deleting

    project = Mite::Project.find(1209)
    project.destroy


{'fraction_non_alphanumeric': 0.09781021897810219, 'fraction_numerical': 0.01070559610705596, 'mean_word_length': 3.4539544962080173, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2796281', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1232, 'n_words': 472}