Sha256: d73ad37bfbdcf08ac9b7c3e92f5b0a826229bd51cd5359a1d8e0d1bf64ae2432

Contents?: true

Size: 969 Bytes

Versions: 2

Compression:

Stored size: 969 Bytes

Contents

module SourceFinder
  # Globber for Ruby
  module RubySourceFileGlobber
    attr_accessor :ruby_dirs_arr, :extra_ruby_files_arr,
                  :ruby_file_extensions_glob,
                  :ruby_file_extensions_arr

    def ruby_dirs_arr
      @ruby_dirs_arr ||= %w(app config db feature lib spec src test)
    end

    def extra_ruby_files_arr
      @extra_ruby_files_arr ||= %w(Rakefile)
    end

    def ruby_file_extensions_arr
      make_extensions_arr(@ruby_file_extensions_glob,
                          @ruby_file_extensions_arr,
                          %w(gemspec rake rb))
    end

    def ruby_file_extensions_glob
      @ruby_file_extensions_glob || ruby_file_extensions_arr.join(',')
    end

    def ruby_files_glob
      make_files_glob(extra_ruby_files_arr, ruby_dirs_arr,
                      ruby_file_extensions_glob)
    end

    def ruby_files_arr
      exclude_garbage(@globber.glob(ruby_files_glob) - exclude_files_arr)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
source_finder-2.4.1 lib/source_finder/langs/ruby.rb
source_finder-2.4.0 lib/source_finder/langs/ruby.rb