<commit_before># Cmtool
[<img src="https://secure.travis-ci.org/bterkuile/cmtool.png?branch=master"
alt="Build Status" />](http://travis-ci.org/bterkuile/cmtool)
## About
Cmtool is a CMS to give you a quickstart for a website using CouchDB as
database backend. It is in developing stage, but already used in production.
It is designed as an engine. The thought behind is that you will have to
create your own rails website, but get a lot of stuff for free. These things
are:

*   User management
*   Page management
*   Faq
*   News
*   Newsletter subscriptions
*   Directory manager
*   Image manager


## Setup
To start using Cmtool as website CMS add it to your Gemfile. Since it  depends
on github gems and gem dependencies do not support those you have to
explicitly add two dependencies to your Gemfile:
    gem 'couch_potato' , :git => 'git://github.com/bterkuile/couch_potato.git'
    gem 'simply_stored' , :git => 'git://github.com/bterkuile/simply_stored.git'
    gem 'cmtool'

This will add some gems you might like anyway, here a list:

*   bourbon
*   jquery-rails
*   tinymce-rails
*   sass-rails
*   haml-rails
*   paperclip
*   email_validator (validates :email, email: true)


### Controllers

in `app/controllers/pages_controller.rb`:

```ruby
class PagesController
  include Cmtool::Includes::PagesController
end
```

in `app/models/page.rb`:
```ruby
class Page
  include Cmtool::Includes::Page

  def self.layouts
    %w[home application contact]
  end
end
```

### Securing

Cmtool is looking for an authorize_cmtool method present in the application
controller. Something like:

```ruby
class ApplicationController
  ...

  private

  def authorize_cmtool
    redirect_to main_app.root_path, alert: t('general.unauthorized') unless current_user.present? && current_user.is_admin?
  end
end
```

### Routing

Add the following routes:
```ruby
devise_for :users, :controllers => {:sessions => 'cmtool/sessions', :passwords => 'cmtool/passwords'}
mount Cmtool::Engine => '/cmtool'
get '/sitemap(.:format)' => 'pages#sitemap'
scope '(/:locale)', constraints: {locale: /nl|be|de|fr|en/}, defaults: { locale: :nl } do
  get "/:name" => "pages#show", constraints: {name: /.*/},  as: :page
end
match "/*url" => "pages#not_found"
root :to => 'pages#home'
```
<commit_msg>remove old match route statement from readme<commit_after># Cmtool
[<img src="https://secure.travis-ci.org/bterkuile/cmtool.png?branch=master"
alt="Build Status" />](http://travis-ci.org/bterkuile/cmtool)
## About
Cmtool is a CMS to give you a quickstart for a website using CouchDB as
database backend. It is in developing stage, but already used in production.
It is designed as an engine. The thought behind is that you will have to
create your own rails website, but get a lot of stuff for free. These things
are:

*   User management
*   Page management
*   Faq
*   News
*   Newsletter subscriptions
*   Directory manager
*   Image manager


## Setup
To start using Cmtool as website CMS add it to your Gemfile. Since it  depends
on github gems and gem dependencies do not support those you have to
explicitly add two dependencies to your Gemfile:
    gem 'couch_potato' , :git => 'git://github.com/bterkuile/couch_potato.git'
    gem 'simply_stored' , :git => 'git://github.com/bterkuile/simply_stored.git'
    gem 'cmtool'

This will add some gems you might like anyway, here a list:

*   bourbon
*   jquery-rails
*   tinymce-rails
*   sass-rails
*   haml-rails
*   paperclip
*   email_validator (validates :email, email: true)


### Controllers

in `app/controllers/pages_controller.rb`:

```ruby
class PagesController
  include Cmtool::Includes::PagesController
end
```

in `app/models/page.rb`:
```ruby
class Page
  include Cmtool::Includes::Page

  def self.layouts
    %w[home application contact]
  end
end
```

### Securing

Cmtool is looking for an authorize_cmtool method present in the application
controller. Something like:

```ruby
class ApplicationController
  ...

  private

  def authorize_cmtool
    redirect_to main_app.root_path, alert: t('general.unauthorized') unless current_user.present? && current_user.is_admin?
  end
end
```

### Routing

Add the following routes:
```ruby
devise_for :users, :controllers => {:sessions => 'cmtool/sessions', :passwords => 'cmtool/passwords'}
mount Cmtool::Engine => '/cmtool'
get '/sitemap(.:format)' => 'pages#sitemap'
scope '(/:locale)', constraints: {locale: /nl|be|de|fr|en/}, defaults: { locale: :nl } do
  get "/:name" => "pages#show", constraints: {name: /.*/},  as: :page
end
get "/*url" => "pages#not_found"
root :to => 'pages#home'
```

{'fraction_non_alphanumeric': 0.12181857733304328, 'fraction_numerical': 0.0, 'mean_word_length': 4.278989667049369, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 2, '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': '2288166', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1495, 'n_words': 490}