Sha256: 42924f2b9d9e8352ff1b8eb5f50811e66f112b5f3fc61e876b855432496efd9a

Contents?: true

Size: 910 Bytes

Versions: 8

Compression:

Stored size: 910 Bytes

Contents

module MagicLamp
  class LintController < MagicLamp::ApplicationController
    def index
      config_errors? && return
      errors = MagicLamp.lint_fixtures
      file_errors?(errors) && return
      fixture_errors?(errors) && return

      render :no_errors
    end

    private

    def file_errors?(errors)
      @file_errors = errors[:files]
      render :file_errors if @file_errors.present?
      @file_errors.present?
    end

    def fixture_errors?(errors)
      @fixture_errors = errors[:fixtures]
      render :fixture_errors if @fixture_errors.present?
      @fixture_errors.present?
    end

    def config_errors?
      @config_errors = MagicLamp.lint_config
      if @config_errors.present? && @config_errors[:config_file_load]
        render :config_file_load_error
      elsif @config_errors.present?
        render :callback_errors
      end
      @config_errors.present?
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
magic_lamp-1.8.1 app/controllers/magic_lamp/lint_controller.rb
magic_lamp-1.8.0 app/controllers/magic_lamp/lint_controller.rb
magic_lamp-1.7.0 app/controllers/magic_lamp/lint_controller.rb
magic_lamp-1.6.2 app/controllers/magic_lamp/lint_controller.rb
magic_lamp-1.6.1 app/controllers/magic_lamp/lint_controller.rb
magic_lamp-1.6.0 app/controllers/magic_lamp/lint_controller.rb
magic_lamp-1.5.2 app/controllers/magic_lamp/lint_controller.rb
magic_lamp-1.5.1 app/controllers/magic_lamp/lint_controller.rb