Sha256: fa50108edba1cc3a7007a75a3649dfdd98337ac01ca060bf6638228ac5ab3575

Contents?: true

Size: 561 Bytes

Versions: 6

Compression:

Stored size: 561 Bytes

Contents

require 'highline/import'

# Controller for command line thingies
class CommandlineController < ApplicationController
    def perform_action
        if self.class.action_methods.include?(action_name.to_s) || 
           self.class.action_methods.include?('method_missing')
            @exitcode = send(action_name,*params["args"]) || 0
            render unless performed?
        elsif template_exists? && template_public?
            render
        else
            raise UnknownAction, "No action responded to #{action_name}", caller
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sugoi-mail-0.0.5 app/controllers/commandline_controller.rb
sugoi-mail-0.0.2 app/controllers/commandline_controller.rb
sugoi-mail-0.1.0 app/controllers/commandline_controller.rb
sugoi-mail-0.0.1 app/controllers/commandline_controller.rb
sugoi-mail-0.0.3 app/controllers/commandline_controller.rb
sugoi-mail-0.1.5 app/controllers/commandline_controller.rb