Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Quality Assurance and Testing

    RailsTidy 0.1

    Download button

    No screenshots available
    Downloads: 407  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Damien Merenne | More programs
    MIT/X Consortium Lic... / FREE
    February 16th, 2006, 16:30 GMT
    ROOT / Programming / Quality Assurance and Testing

     Read user reviews (0)  Refer to a friend  Subscribe

    RailsTidy description

    RailsTidy is a plugin for Ruby On Rails.

    RailsTidy project is a plugin for Ruby On Rails.

    Here are some key features of "RailsTidy":

    · validate your rhtml templates,
    · validate the html output of your functional tests,
    · clean the html generated by rails.

    Requirements:

    · Tidy, the popular HTML validator and
    · RubyTidy, Ruby bindings for Tidy.

    Installation:

    Unpack into the vendor/plugin and that should be it. Ruby bindings for libtidy need to know the path to the file libtidy.so. It is assumed to be found at /usr/lib/libtidy.so . If this is not the case, add

    RailsTidy.tidy_path = "/path/to/your/libtidy.so"

    to your environment file.

    Configuration:

    If the file config/tidy.rc exists, it will use it to configure Tidy. If you want to use another file, put

    RailsTidy.tidy_configuration = "/path/to/a/tidy/configuration/file"

    to your environment file.

    Usage:

    Validating templates

    Simply use

    $ rake test_templates

    By default, the plugin will parse all *.rhtml files in your app/views directory. If you want to validate only one file, use

    $ rake test_templates FILE="path/to/the/file"

    If $FILE is a directory, it will search for all *.rhtml file in it and try to validates them. If $FILE is a regular file it will be validated. If $FILE does not exists it will try with:
    ".rhtml" appended to $FILE,
    the app/view directory prepended to $FILE,
    the app/view directory prepended and ".rhtml" appended to $FILE

    Validating html output

    The plugin adds a new assert_tidy method to the Test::Unit::TestCase class. You can use it in your class by simply call it with no arguments. It will validate the last response returned by a test. For example:

    get :index
    assert_sucess
    assert_tidy

    Cleaning rails html output

    The plugin allows you to clean the html produced by rails. To enable it, use an after filter in your app/controller/application.rb file

    class ApplicationController < ActionController::Base
    after_filter :tidy
    def tidy
    RailsTidy.filter(response)
    end
    end

    WARNING: THIS IS CERTAINLY A RESOURCE HOG. I’m not interrested in this feature so I didn’t benchmarked it but at first sight rendering is at least 2 times slower with the filter enabled.

    Product's homepage

      


    TAGS:

    Ruby On Rails plugin | Ruby plugin | quality testing | RailsTidy | Ruby On Rails | Ruby

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM