Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple blog engine built using sinatra
Ruby JavaScript
tag: v1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.bundle
app
config
db
public
tests
.gitignore
Gemfile.lock
README.rdoc
config.ru
gemfile
rakefile.rb

README.rdoc

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: dan@shout_mouth.com 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 url=yourblog.com user=username password=password posts=number_of_posts current_user_email=email from_blog_engine={{your_engine}} Currently only supports blogengine.net 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!)

Tests

To run all the tests rake specs:run_all

Rails Style Console

racksh - when in the application root

Tested Blogging Clients

  • Windows Live Writer (fully supported)

  • Wordpress Client For Ipad - (ropey at best - will be fully functional once the full wordpress API is implemented)

  • Blogger Client For Ipad - (ropey at best - this is due to the clients interpretation of how the API should work - - will be fully functional once the full wordpress API is implemented)

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/#{easy_rider.bike}”, :rel => “follow”}=easy_rider.bike 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.