Parent

Spork::AppFramework

Constants

SUPPORTED_FRAMEWORKS

A hash of procs where the key is the class name, and the proc takes no arguments and returns true if it detects that said application framework is being used in the project.

The key :Rails maps to Spork::AppFramework::Rails

This is used to reduce the amount of code needed to be loaded - only the detected application framework’s support code is loaded.

Public Class Methods

[](name) click to toggle source

Initializes, stores, and returns a singleton instance of the named AppFramework.

Parameters

# name - A symbolic name of a AppFramework subclass

Example

  Spork::AppFramework[:Rails]
    # File lib/spork/app_framework.rb, line 45
45:   def self.[](name)
46:     instances[name] ||= const_get(name).new
47:   end
detect_framework() click to toggle source

Same as detect_framework_name, but returns an instance of the specific AppFramework class.

    # File lib/spork/app_framework.rb, line 31
31:   def self.detect_framework
32:     name = detect_framework_name
33:     self[name]
34:   end
detect_framework_name() click to toggle source

Iterates through all SUPPORTED_FRAMEWORKS and returns the symbolic name of the project application framework detected. Otherwise, returns :Unknown

    # File lib/spork/app_framework.rb, line 23
23:   def self.detect_framework_name
24:     SUPPORTED_FRAMEWORKS.each do |key, value|
25:       return key if value.call
26:     end
27:     :Unknown
28:   end
setup_autoload() click to toggle source
    # File lib/spork/app_framework.rb, line 16
16:   def self.setup_autoload
17:     ([:Unknown] + SUPPORTED_FRAMEWORKS.keys).each do |name|
18:       autoload name, File.join(File.dirname(__FILE__), "app_framework", name.to_s.downcase)
19:     end
20:   end
short_name() click to toggle source
    # File lib/spork/app_framework.rb, line 49
49:   def self.short_name
50:     name.gsub('Spork::AppFramework::', '')
51:   end

Protected Class Methods

instances() click to toggle source
    # File lib/spork/app_framework.rb, line 72
72:     def self.instances
73:       @instances ||= {}
74:     end

Public Instance Methods

bootstrap_required?() click to toggle source

If there is some stuff out of the box that the Spork can do to speed up tests without the test helper file being bootstrapped, this should return false.

    # File lib/spork/app_framework.rb, line 54
54:   def bootstrap_required?
55:     entry_point.nil?
56:   end
entry_point() click to toggle source

Abstract: The path to the file that loads the project environment, ie config/environment.rb. Returns nil if there is none.

    # File lib/spork/app_framework.rb, line 59
59:   def entry_point
60:     raise NotImplementedError
61:   end
preload(&block) click to toggle source
    # File lib/spork/app_framework.rb, line 63
63:   def preload(&block)
64:     yield
65:   end
short_name() click to toggle source
    # File lib/spork/app_framework.rb, line 67
67:   def short_name
68:     self.class.short_name
69:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.