Sha256: 2b9c8a05840c245f2bb3434927fd9789dd6e0576ef1c3431a86f7feb514562f6

Contents?: true

Size: 817 Bytes

Versions: 19

Compression:

Stored size: 817 Bytes

Contents

module Merb
  
  module Rack
    
    class Runner
      # ==== Parameters
      # opts<Hash>:: Options for the runner (see below).
      #
      # ==== Options (opts)
      # :runner_code<String>:: The code to run.
      #
      # ==== Notes
      # If opts[:runner_code] matches a filename, that file will be read and
      # the contents executed. Otherwise the code will be executed directly.
      #
      # :api: plugin
      def self.start(opts={})
        Merb::Server.change_privilege
        if opts[:runner_code]
          if File.exists?(opts[:runner_code])
            eval(File.read(opts[:runner_code]), TOPLEVEL_BINDING, __FILE__, __LINE__)
          else
            eval(opts[:runner_code], TOPLEVEL_BINDING, __FILE__, __LINE__)
          end
          exit
        end  
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
merb-core-1.0.15 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.14 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.13 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.12 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.2 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.10 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.11 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.1 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.3 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.4 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.6.1 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.5 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.8.1 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.7 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.7.1 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.6 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.9 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0.8 lib/merb-core/rack/adapter/runner.rb
merb-core-1.0 lib/merb-core/rack/adapter/runner.rb