Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple blog engine built using sinatra
Ruby JavaScript
branch: mail

This branch is 123 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


Features For Version 2.0

  • Implement Auto-setup

  • Administration System

- manage users - manage tags - manage categories - manage settings (will need to move settings from yaml to db) - manage edit / add posts

  • Tags url & Categories url should be made safe (for upgrade we will need legacy redirects for these now.)

Known Issues

  • Error relating to permissions on the db folder and shout_mouth.db file (Cannot connect to readonly database) - change permissions on the file and folder to rectify this. rake:sqlite_file_permissions

  • Error writing to the public/cache directory - you need to fix permissions so that the webservers process can read/write from/to the folder.

Demo Information

Runs the site on test data (bundler must be installed)

bundle install (I would recommend using RVM to manage your GEMSETS - ruby 1.9.2) rake db:demo_data shotgun –env=test browse to the localhost:9393 connect your blogging client to localhost:9393/xmlrpc or localhost:9393/xmlrpc.php (default wordpress) with username: password: password123

Rake Tasks

rake db:create (Create The Database) rake db:delete (Delete Database) rake db:demo_data (Seed Demo Data) rake db:update (Upgrade The Database To The Latest Schema Version) rake import:posts user=username password=password posts=number_of_posts current_user_email=email from_blog_engine={{your_engine}} Currently only supports for the from_blog_engine argument - this is just used to set legacy redirects Before running this rake task you should run rake users:create and then set the current_user_email argument to the freshly created users email

rake import:remove_height_and_width_from_images (Remove all image tags height and width attributes from all posts - I have found that some blog clients add height and width attributes to image tags)

rake import:repoint_images upload=1 (Updates all images paths to point to your Amazon S3 account - if upload is set to 0 then the s3 upload will not occur but all image tags stored in each post will be repointed to your amazon s3 account - rake task uses the amazon s3 production settings located inside config/config.yaml)

rake specs:run_all - (Run All The Specs)

rake user:create create email=email password=password firstname=firstname lastname=lastname (Create a user)

Rails Style Console

	type racksh inside the console when in the shout_mouth directory - (supports reload!)


To run all the tests rake specs:run_all

Rails Style Console

racksh - when in the application root -eg RACK_ENV=production racksh

Caching On NGINX

-place the following code in the server block of the nginx config if (-f $request_filename) { break; }

if (-f $document_root/cache$request_filename) { rewrite (.*) /cache$1 break; break; }

if (-f $document_root/cache$request_uri.html) { rewrite (.*) /cache$1.html break; break; }

if (-f $document_root/cache$request_uri/index.html) { rewrite (.*) /cache$1/index.html break; break; }

Writing Plugins For Shout Mouth

1) Create a directory structure inside the app/plugins folder as shown below.

  • Convention matters

-app —-plugins ———–easy_rider —————easy_rider_plugin.rb ———–view ————-easy_rider_plugin.haml 2) The information below is based on writing a new plugin called “easy rider”

  • our easy_rider plugin should contain a class file named easy_rider_plugin.rb whose class name should be EasyRiderPlugin

  • our easy_rider_plugin.rb file needs to reside in a folder called easy_rider under the plugins directory (see above)

  • EasyRiderPlugin class should inherit the base class Plugin (see below)

  • EasyRiderPlugin class should implement one method from the base class which is data (see below)

class EasyRiderPlugin < Plugin def data Post.all_active #or any other data from the model api end end

  • All classes that inherit from Plugin have access to all of shout mouths model classes and data

  • our EasyRiderPlugin classes data method can return any object and will be passed down to the view

  • a HAML layout file should be included in the view folder called easy_rider_plugin.haml. The view folder should reside under the easy rider directory

  • by convention the variable name containing the returned data inside the view will be called easy_rider

-easy_rider.each do |easy_rider| %li %a{:href => “/bikes/#{}”, :rel => “follow”} 3) To place a plugin on one of your pages just call the following code (example is for easy rider).

  • please note you may need to restart your application for your plugin to register

= plugin(PluginFactory.instance.get_plugin(:easy_rider))

Something went wrong with that request. Please try again.