Sha256: 69655088581ebbd86786d9dabb97883f0217d314d111f4ef35615aa4c45821e3

Contents?: true

Size: 886 Bytes

Versions: 13

Compression:

Stored size: 886 Bytes

Contents

class Jax::SuiteController < ActionController::Base
  layout :layout
  helper_method :webgl_start
  
  def index
    redirect_to :action => :run_webgl
  end
  
  def jasmine
    # order helpers before specs
    @specs = helpers + specs
  end
  
  def spec
    render :text => Jax.config.specs[params[:id]].to_s
  end
  
  private
  def webgl_start
    Jax.config.webgl_start
  end
  
  def helpers
    collect_spec_files_matching /_helper\./
  end
  
  def specs
    collect_spec_files_matching /([sS]pec|[tT]est)\./
  end
  
  def collect_spec_files_matching(pattern)
    [].tap do |files|
      Jax.config.specs.each_file do |file|
        file = Jax.config.specs.attributes_for(file).logical_path
        if file =~ pattern
          files << file
        end
      end
    end
  end
  
  def layout
    case params[:action]
    when 'spec' then nil
    else 'jax'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
jax-2.0.12 app/controllers/jax/suite_controller.rb
jax-2.0.11 app/controllers/jax/suite_controller.rb
jax-2.0.10 app/controllers/jax/suite_controller.rb
jax-2.0.9 app/controllers/jax/suite_controller.rb
jax-2.0.8 app/controllers/jax/suite_controller.rb
jax-2.0.7 app/controllers/jax/suite_controller.rb
jax-2.0.6 app/controllers/jax/suite_controller.rb
jax-2.0.5 app/controllers/jax/suite_controller.rb
jax-2.0.4 app/controllers/jax/suite_controller.rb
jax-2.0.3 app/controllers/jax/suite_controller.rb
jax-2.0.2 app/controllers/jax/suite_controller.rb
jax-2.0.1 app/controllers/jax/suite_controller.rb
jax-2.0.0 app/controllers/jax/suite_controller.rb