Sha256: 86eb150d5f382b2d1da2a97ba2e79b197c15ee7a2f6a6d57af6044835c7410ae

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

module CodeLister
  class Main
    class << self

      def run(options = {})
        args = default_options.merge(options)

        files = CodeLister.files(args)

        ## Now filter out the list any?
        inc_words = args.fetch(:inc_words, [])
        exc_words = args.fetch(:exc_words, [])

        files = CodeLister.filter(files, inc_words: inc_words,
                                         exc_words: exc_words)

        # Note: for now just print out the list of files
        puts files

        files
      end

      private

      def default_options
        options = {
          base_dir: Dir.pwd,
          recursive: false,
          ignore_case: true,
          inc_words: [],
          exc_words: [],
          exts: []
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
code_lister-0.0.4 lib/code_lister/main.rb