Sha256: b0e808189456439e80ed89456b8b161ee441d4b8a619379e92602b8fd81b5aaa

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

# encoding: utf-8

module Fixture
  class Error < StandardError
    include CLAide::InformativeError
  end

  class Command < CLAide::Command
    self.command = 'bin'
    self.ansi_output = false

    class << self
      attr_accessor :latest_instance
    end

    def initialize(*args)
      self.class.latest_instance = self
      super
    end

    class SpecFile < Command
      self.abstract_command = true
      self.description = 'Manage spec files.'

      class CommonInvisibleCommand < SpecFile
        self.ignore_in_command_lookup = true
      end

      class Lint < CommonInvisibleCommand
        self.summary = 'Checks the validity of a spec file.'
        self.arguments = [
          CLAide::Argument.new('NAME', false),
        ]

        def self.options
          [['--only-errors', 'Skip warnings']].concat(super)
        end

        class Repo < Lint
          self.summary = 'Checks the validity of ALL specs in a repo.'
        end
      end

      class Create < CommonInvisibleCommand
        self.summary = 'Creates a spec file stub.'
        self.description = <<-DESC
          Creates a spec file called NAME
          and populates it with defaults.
        DESC
        self.arguments = [
          CLAide::Argument.new('NAME', false),
        ]

        attr_reader :spec
        def initialize(argv)
          @spec = argv.shift_argument
          super
        end
      end
    end
  end

  class CommandPluginable < CLAide::Command
    plugin_prefixes << 'fixture'
    self.ansi_output = false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
claide-completion-1.0.2 spec/spec_helper/fixtures.rb