Project

autorun

0.0
No commit activity in last 3 years
No release in over 3 years
A simple scripting helper module
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.5
>= 0
>= 0
 Project Readme

Autorun

Build Status Coverage Status Code Climate

Autorun is a simple scripting helper module. It allows you write a simple executable script per class easily.

Usage

Autorun is a module which invokes 'run' method automatically.

  • Implement an executable class and include Autorun.
    #!/usr/bin/env ruby
    require 'autorun'

    class DailyBatch
      include Autorun

      def run
        # ...
      end
    end
  • Then execute it.
    $ ruby daily_batch.rb
  • When you need to use other method name instead of 'run', use simply alias_method.
    class WorkerJob
      include Autorun

      def perform
        # ...
      end

      alias_method :run, :perform
    end
  • Autorun does not provide other features such as option parser, please use appropriate gem like 'thor' or 'slop'.

Contributing

  1. Fork it ( http://github.com/twodollarz/autorun/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request