Sha256: 0f1c613a637d62208d3adc2de8782757328f322646ea36e829afb55b6c4623ed

Contents?: true

Size: 631 Bytes

Versions: 3

Compression:

Stored size: 631 Bytes

Contents

module RShade
  class Configuration
    RUBY_VERSION_PATTERN = /ruby-[0-9.]*/

    attr_accessor :custom_arg_print, :included_gems

    def initialize
      @included_gems = []
    end

    def default_arg_print(args)

    end

    def excluded_paths
      @excluded_paths ||= begin
        paths = [ENV['GEM_PATH'].split(':'), parse_ruby_version].flatten.compact
        paths.reject do |v|
          included_gems.any? { |gem_name| v.include? gem_name }
        end
      end
    end

    def parse_ruby_version
      val = RUBY_VERSION_PATTERN.match(ENV['GEM_PATH'])
      return nil unless val

      val[0]
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rshade-0.1.6 lib/rshade/configuration.rb
rshade-0.1.5 lib/rshade/configuration.rb
rshade-0.1.4 lib/rshade/configuration.rb