Sha256: 919e70d69e5e6ee78dbd21f5206172b593a44c52d0cd779246b194ec65a8896a

Contents?: true

Size: 861 Bytes

Versions: 80

Compression:

Stored size: 861 Bytes

Contents

module Standard
  module Performance
    class DeterminesYamlPath
      def determine(desired_version)
        desired_version = Gem::Version.new(desired_version) unless desired_version.is_a?(Gem::Version)
        default = "base.yml"

        file_name = if !Gem::Version.correct?(desired_version)
          default
        elsif desired_version < Gem::Version.new("1.9")
          "ruby-1.8.yml"
        elsif desired_version < Gem::Version.new("2.0")
          "ruby-1.9.yml"
        elsif desired_version < Gem::Version.new("2.1")
          "ruby-2.0.yml"
        elsif desired_version < Gem::Version.new("2.2")
          "ruby-2.1.yml"
        elsif desired_version < Gem::Version.new("2.3")
          "ruby-2.2.yml"
        else
          default
        end

        Pathname.new(__dir__).join("../../../config/#{file_name}")
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 3 rubygems

Version Path
standard-performance-1.5.0 lib/standard/performance/determines_yaml_path.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
standard-performance-1.3.1 lib/standard/performance/determines_yaml_path.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.1.96 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.1.95 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb
harbr-0.1.94 vendor/bundle/ruby/3.2.0/gems/standard-performance-1.2.1/lib/standard/performance/determines_yaml_path.rb