codeclimate/codeclimate-yaml

View on GitHub
lib/cc/yaml/nodes/glob.rb

Summary

Maintainability
A
0 mins
Test Coverage
module CC
  module Yaml
    module Nodes
      class Glob < Scalar
        def to_s
          value
        end

        def value
          # normalize glob format: app/** => app/**/* and **.rb => **/*.rb
          @value && @value.sub(%r{\*\*([^\/]*)?$}, "**/*\\1")
        end
      end
    end
  end
end