Sha256: 6d7edda09945e7d379a683ed5f67610882d5841beb75dbbee7e63dc942ba21c2

Contents?: true

Size: 875 Bytes

Versions: 15

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true

module Jets
  module Command
    class NotesCommand < Base # :nodoc:
      class_option :annotations, aliases: "-a", desc: "Filter by specific annotations, e.g. Foobar TODO", type: :array

      def perform(*)
        require_application_and_environment!

        # lazy require so Rails const is only defined when using notes
        require "rails/source_annotation_extractor"

        display_annotations
      end

      private
        def display_annotations
          annotations = options[:annotations] || Rails::SourceAnnotationExtractor::Annotation.tags
          tag = (annotations.length > 1)

          Rails::SourceAnnotationExtractor.enumerate annotations.join("|"), tag: tag, dirs: directories
        end

        def directories
          Rails::SourceAnnotationExtractor::Annotation.directories
        end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/commands/notes/notes_command.rb
jets-5.0.12 lib/jets/commands/notes/notes_command.rb
jets-5.0.11 lib/jets/commands/notes/notes_command.rb
jets-5.0.10 lib/jets/commands/notes/notes_command.rb
jets-5.0.9 lib/jets/commands/notes/notes_command.rb
jets-5.0.8 lib/jets/commands/notes/notes_command.rb
jets-5.0.7 lib/jets/commands/notes/notes_command.rb
jets-5.0.6 lib/jets/commands/notes/notes_command.rb
jets-5.0.5 lib/jets/commands/notes/notes_command.rb
jets-5.0.4 lib/jets/commands/notes/notes_command.rb
jets-5.0.3 lib/jets/commands/notes/notes_command.rb
jets-5.0.2 lib/jets/commands/notes/notes_command.rb
jets-5.0.1 lib/jets/commands/notes/notes_command.rb
jets-5.0.0 lib/jets/commands/notes/notes_command.rb
jets-5.0.0.beta1 lib/jets/commands/notes/notes_command.rb